Thread (13 messages) 13 messages, 5 authors, 2017-11-14

Re: [v11,1/4] drivers: jtag: Add JTAG core driver

From: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Date: 2017-11-14 11:10:50
Also in: linux-arm-kernel, linux-devicetree, linux-serial, lkml, openbmc

On Tue, Nov 14, 2017 at 10:34:49AM +0000, Oleksandr Shamray wrote:
quoted
-----Original Message-----
From: Chip Bilbrey [mailto:chip@bilbrey.org]
Sent: Monday, November 6, 2017 12:33 AM
To: Oleksandr Shamray <redacted>
Cc: gregkh@linuxfoundation.org; arnd@arndb.de; linux-
kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
devicetree@vger.kernel.org; openbmc@lists.ozlabs.org; joel@jms.id.au;
jiri@resnulli.us; tklauser@distanz.ch; linux-serial@vger.kernel.org;
mec@shout.net; Vadim Pasternak [off-list ref]; system-sw-low-
level [off-list ref]; robh+dt@kernel.org; openocd-
devel-owner@lists.sourceforge.net; linux-api@vger.kernel.org;
davem@davemloft.net; mchehab@kernel.org; Jiri Pirko [off-list ref]
Subject: Re: [v11,1/4] drivers: jtag: Add JTAG core driver


Oleksandr Shamray writes:
[..]
quoted
I notice the single-open()-per-device lock was dropped by request in an earlier
revision of your patches, but multiple processes trying to drive a single JTAG
master could wreak serious havoc if transactions get interleaved. Would
something like an added JTAG_LOCKCHAIN/UNLOCKCHAIN
ioctl() for exclusive client access be reasonable to prevent this?
Yes, it dropped by recommendation of Greg KH [off-list ref]. 
I asked to drop it as you didn't even implement it to work correctly :)
Greg, what you can suggest about it. May be better to add again single-open()-per-device lock with right locking way like:
quoted
if (mutex_lock_interruptible(&jtag->open_lock)) {
You would stall an open?  Why not just return saying you can't do that?

Anyway, if you want to only have one access to the device at a time,
great, but do it in a way that works properly.

thanks,

greg k-h
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help