[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DB6PR0501MB219753AC43515148F39CC2D0B1280@DB6PR0501MB2197.eurprd05.prod.outlook.com>
Date: Tue, 14 Nov 2017 10:34:49 +0000
From: Oleksandr Shamray <oleksandrs@...lanox.com>
To: 'Chip Bilbrey' <chip@...brey.org>
CC: "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"arnd@...db.de" <arnd@...db.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"openbmc@...ts.ozlabs.org" <openbmc@...ts.ozlabs.org>,
"joel@....id.au" <joel@....id.au>,
"jiri@...nulli.us" <jiri@...nulli.us>,
"tklauser@...tanz.ch" <tklauser@...tanz.ch>,
"linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
"mec@...ut.net" <mec@...ut.net>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"openocd-devel-owner@...ts.sourceforge.net"
<openocd-devel-owner@...ts.sourceforge.net>,
"linux-api@...r.kernel.org" <linux-api@...r.kernel.org>,
"davem@...emloft.net" <davem@...emloft.net>,
"mchehab@...nel.org" <mchehab@...nel.org>,
Jiri Pirko <jiri@...lanox.com>
Subject: RE: [v11,1/4] drivers: jtag: Add JTAG core driver
> -----Original Message-----
> From: Chip Bilbrey [mailto:chip@...brey.org]
> Sent: Monday, November 6, 2017 12:33 AM
> To: Oleksandr Shamray <oleksandrs@...lanox.com>
> Cc: gregkh@...uxfoundation.org; arnd@...db.de; linux-
> kernel@...r.kernel.org; linux-arm-kernel@...ts.infradead.org;
> devicetree@...r.kernel.org; openbmc@...ts.ozlabs.org; joel@....id.au;
> jiri@...nulli.us; tklauser@...tanz.ch; linux-serial@...r.kernel.org;
> mec@...ut.net; Vadim Pasternak <vadimp@...lanox.com>; system-sw-low-
> level <system-sw-low-level@...lanox.com>; robh+dt@...nel.org; openocd-
> devel-owner@...ts.sourceforge.net; linux-api@...r.kernel.org;
> davem@...emloft.net; mchehab@...nel.org; Jiri Pirko <jiri@...lanox.com>
> Subject: Re: [v11,1/4] drivers: jtag: Add JTAG core driver
>
>
> Oleksandr Shamray writes:
[..]
> 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 <gregkh@...uxfoundation.org>.
Greg, what you can suggest about it. May be better to add again single-open()-per-device lock with right locking way like:
>if (mutex_lock_interruptible(&jtag->open_lock)) {
> return -ERESTARTSYS;
>}
>
>if (jtag->opened) {
> mutex_unlock(&jtag->open_lock);
> return -EINVAL;
>}
>
>nonseekable_open(inode, file);
>file->private_data = jtag;
>jtag->opened++;
>mutex_unlock(&jtag->open_lock);
>
Thaks.
> -Chip
Powered by blists - more mailing lists