Re: usbtmc: vendor specific i/o

2016-09-28 Thread Dave Penkler
On Wed, Sep 28, 2016 at 12:29:35PM +0200, Ladislav Michl wrote: > On Wed, Sep 28, 2016 at 11:45:02AM +0200, Greg Kroah-Hartman wrote: > > If it is freed, why is a read even able to happen? Ah, ick, no proper > > reference counting is happening here :( > > > > Oh, no, wait, it is happening properl

[PATCH] usbtmc: Add, clarify and fix comments

2016-09-28 Thread Dave Penkler
Add information regarding lifespan of kref protection: Clarify comment on kref_get for interrupt in urb in usbtmc_probe() Add comment on kref_get in usbtmc_open() Fix endpoint reference in documentation for send_request_dev_dep_msg_in() Signed-off-by: Dave Penkler --- drivers/usb/class

Re: [PATCH v6 4/5] Add ioctl to retrieve USBTMC-USB488 capabilities

2016-01-26 Thread Dave Penkler
On Sun, Jan 24, 2016 at 08:42:54PM -0800, Greg KH wrote: > On Sun, Nov 29, 2015 at 01:35:51PM +0100, Dave Penkler wrote: > > This is a convenience function to obtain an instrument's > > capabilities from its file descriptor without having to access sysfs > > from the use

[PATCH v7 0/5] usb: usbtmc: Add support for missing functions in USBTMC-USB488 spec

2016-01-27 Thread Dave Penkler
- simplify some expressions v3 - Split into multiple patches as per gregkh request V2 - Fix V1 bug: not waking sleepers on disconnect. - Correct sparse warnings. V1 - Original patch Testing: All functions tested ok on an USBTMC-USB488 compliant oscilloscope Dave Penkler (5

[PATCH v7 1/5] Implement an ioctl to support the USMTMC-USB488 READ_STATUS_BYTE operation.

2016-01-27 Thread Dave Penkler
appropriate condition. This capability is referred to in instrument application notes on synchronizing acquisitions for other platforms. Signed-off-by: Dave Penkler --- drivers/usb/class/usbtmc.c | 201 +++ include/uapi/linux/usb/tmc.h | 2 + 2 files changed, 203

[PATCH v7 2/5] Add support for USBTMC USB488 SRQ notification with fasync

2016-01-27 Thread Dave Penkler
Background: By configuring an instrument's event status register various conditions can be reported via an SRQ notification. This complements the synchronous polling approach using the READ_STATUS_BYTE ioctl with an asynchronous notification. Signed-off-by: Dave Penkler --- drivers/usb/

[PATCH v7 3/5] Add support for receiving USBTMC USB488 SRQ notifications via poll/select

2016-01-27 Thread Dave Penkler
Background: In many situations operations on multiple instruments need to be synchronized. poll/select provide a convenient way of waiting on a number of different instruments and other peripherals simultaneously. Signed-off-by: Dave Penkler --- drivers/usb/class/usbtmc.c | 23

[PATCH v7 4/5] Add ioctl to retrieve USBTMC-USB488 capabilities

2016-01-27 Thread Dave Penkler
This is a convenience function to obtain an instrument's capabilities from its file descriptor without having to access sysfs from the user program. Signed-off-by: Dave Penkler --- drivers/usb/class/usbtmc.c | 12 include/uapi/linux/usb/tmc.h | 21 ++--- 2

[PATCH v7 5/5] Add ioctls to enable and disable local controls on an instrument

2016-01-27 Thread Dave Penkler
These ioctls provide support for the USBTMC-USB488 control requests for REN_CONTROL, GO_TO_LOCAL and LOCAL_LOCKOUT Signed-off-by: Dave Penkler --- drivers/usb/class/usbtmc.c | 70 include/uapi/linux/usb/tmc.h | 6 2 files changed, 76

Re: [PATCH v7 0/5] usb: usbtmc: Add support for missing functions in USBTMC-USB488 spec

2016-01-29 Thread Dave Penkler
Hi Clemens, On Thu, Jan 28, 2016 at 09:46:59AM +0100, Clemens Ladisch wrote: > Dave Penkler wrote: > > Implement support for the USB488 defined READ_STATUS_BYTE ioctl (1/5) > > and SRQ notifications with fasync (2/5) and poll/select (3/5) in order > > to be able to sync

[PATCH] usb: usbtmc: Fix disconnect/poll interaction

2016-02-17 Thread Dave Penkler
When the device is disconnected poll waiters were not being woken. Fixes issue in commit eb6b92ecc0f9412623ab1584ddd8389b371638d4 reported by Oliver Neukum Signed-off-by: Dave Penkler --- drivers/usb/class/usbtmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers

[PATCH v2] usb: usbtmc: Fix disconnect/poll interaction

2016-02-18 Thread Dave Penkler
When the device is disconnected poll waiters were not being woken. Changes for v2: - add commit summary - add Fixes and Reported-by tags Fixes: eb6b92ecc0f9 ("Add support for receiving USBTMC USB488 SRQ notifications via poll/select") Reported-by: Oliver Neukum Signed-of

[PATCH] USB: usbtmc: Add support for missing USBTMC-USB488 spec

2015-10-14 Thread dave penkler
ioctl to return all device capabilities. Signed-off-by: Dave Penkler --- drivers/usb/class/usbtmc.c | 359 +++ include/uapi/linux/usb/tmc.h | 42 +++-- 2 files changed, 391 insertions(+), 10 deletions(-) diff --git a/drivers/usb/class/usbtmc.c b/drivers

Re: [PATCH] USB: usbtmc: Add support for missing USBTMC-USB488 spec

2015-10-14 Thread dave penkler
Hi Oliver, On Wed, Oct 14, 2015 at 3:33 PM, Oliver Neukum wrote: > On Wed, 2015-10-14 at 15:13 +0200, dave penkler wrote: > > Hi, > > just a few remarks. thank you. > >> >> +static int usbtmc488_ioctl_read_stb(struct usbtmc_device_data *data, >> +

[PATCH V2] USB: usbtmc: Add support for missing USBTMC-USB488 spec

2015-10-19 Thread dave penkler
ioctl to return all device capabilities. Fix PATCH V1 bug: not waking sleepers on disconnect. Correct sparse warnings. Signed-off-by: Dave Penkler --- drivers/usb/class/usbtmc.c | 359 +++ include/uapi/linux/usb/tmc.h | 42 +++-- 2 files changed, 391

[PATCH v3 0/5] usb: usbtmc: Add support for missing functions in USBTMC-USB488 spec

2015-11-11 Thread Dave Penkler
on an USBTMC-USB488 compliant oscilloscope Dave Penkler (5): Implement an ioctl to support the USMTMC-USB488 READ_STATUS_BYTE operation. Add support for USBTMC USB488 SRQ notification with fasync Add support for receiving USBTMC USB488 SRQ notifications via poll/select Add ioctl to

[PATCH v3 1/5] Implement an ioctl to support the USMTMC-USB488 READ_STATUS_BYTE operation.

2015-11-11 Thread Dave Penkler
appropriate condition. This capability is refered to in instrument application notes on synchronizing acquisitions for other platforms. Signed-off-by: Dave Penkler --- drivers/usb/class/usbtmc.c | 223 +++ include/uapi/linux/usb/tmc.h | 2 + 2 files changed, 225

[PATCH v3 2/5] Add support for USBTMC USB488 SRQ notification with fasync

2015-11-11 Thread Dave Penkler
Background: By configuring an instrument's event status register various conditions can be reported via an SRQ notification. This complements the synchronous polling approach using the READ_STATUS_BYTE ioctl with an asynchronous notification. Signed-off-by: Dave Penkler --- drivers/usb/

[PATCH v3 3/5] Add support for receiving USBTMC USB488 SRQ notifications via poll/select

2015-11-11 Thread Dave Penkler
Background: In many situations operations on multiple instruments need to be synchronized. poll/select provide a convenient way of waiting on a number of different instruments and other peripherals simultaneously. Signed-off-by: Dave Penkler --- drivers/usb/class/usbtmc.c | 23

[PATCH v3 4/5] Add ioctl to retrieve USBTMC-USB488 capabilities

2015-11-11 Thread Dave Penkler
This is a convenience function to obtain an instrument's capabilities from its file descriptor without having to access sysfs from the user program. Signed-off-by: Dave Penkler --- drivers/usb/class/usbtmc.c | 12 include/uapi/linux/usb/tmc.h | 21 ++--- 2

[PATCH v3 5/5] Add ioctls to enable and disable local controls on an instrument

2015-11-11 Thread Dave Penkler
These ioctls provide support for the USBTMC-USB488 control requests for REN_CONTROL, GO_TO_LOCAL and LOCAL_LOCKOUT Signed-off-by: Dave Penkler --- drivers/usb/class/usbtmc.c | 76 include/uapi/linux/usb/tmc.h | 9 +- 2 files changed, 84

Re: [PATCH v3 5/5] Add ioctls to enable and disable local controls on an instrument

2015-11-13 Thread Dave Penkler
Hi Andy, On Wed, Nov 11, 2015 at 09:36:41PM +0200, Andy Shevchenko wrote: > On Wed, Nov 11, 2015 at 1:21 PM, Dave Penkler wrote: > > These ioctls provide support for the USBTMC-USB488 control requests > > for REN_CONTROL, GO_TO_LOCAL and LOCAL_LOCKOUT snip > > +

[PATCH v4 0/5] usb: usbtmc: Add support for missing functions in USBTMC-USB488 spec

2015-11-15 Thread Dave Penkler
sleepers on disconnect. - Correct sparse warnings. V1 - Original patch Testing: All functions tested ok on an USBTMC-USB488 compliant oscilloscope Dave Penkler (5): Implement an ioctl to support the USMTMC-USB488 READ_STATUS_BYTE operation. Add support for USBTMC USB488 SRQ

[PATCH v4 1/5] Implement an ioctl to support the USMTMC-USB488 READ_STATUS_BYTE operation.

2015-11-15 Thread Dave Penkler
appropriate condition. This capability is referred to in instrument application notes on synchronizing acquisitions for other platforms. Signed-off-by: Dave Penkler --- drivers/usb/class/usbtmc.c | 219 +++ include/uapi/linux/usb/tmc.h | 2 + 2 files changed, 221

[PATCH v4 5/5] Add ioctls to enable and disable local controls on an instrument

2015-11-15 Thread Dave Penkler
These ioctls provide support for the USBTMC-USB488 control requests for REN_CONTROL, GO_TO_LOCAL and LOCAL_LOCKOUT Signed-off-by: Dave Penkler --- drivers/usb/class/usbtmc.c | 76 include/uapi/linux/usb/tmc.h | 6 2 files changed, 82

[PATCH v4 3/5] Add support for receiving USBTMC USB488 SRQ notifications via poll/select

2015-11-15 Thread Dave Penkler
Background: In many situations operations on multiple instruments need to be synchronized. poll/select provide a convenient way of waiting on a number of different instruments and other peripherals simultaneously. Signed-off-by: Dave Penkler --- drivers/usb/class/usbtmc.c | 23

[PATCH v4 4/5] Add ioctl to retrieve USBTMC-USB488 capabilities

2015-11-15 Thread Dave Penkler
This is a convenience function to obtain an instrument's capabilities from its file descriptor without having to access sysfs from the user program. Signed-off-by: Dave Penkler --- drivers/usb/class/usbtmc.c | 12 include/uapi/linux/usb/tmc.h | 21 ++--- 2

[PATCH v4 2/5] Add support for USBTMC USB488 SRQ notification with fasync

2015-11-15 Thread Dave Penkler
Background: By configuring an instrument's event status register various conditions can be reported via an SRQ notification. This complements the synchronous polling approach using the READ_STATUS_BYTE ioctl with an asynchronous notification. Signed-off-by: Dave Penkler --- drivers/usb/

Re: [PATCH v4 1/5] Implement an ioctl to support the USMTMC-USB488 READ_STATUS_BYTE operation.

2015-11-18 Thread Dave Penkler
Hi Andy, On Sun, Nov 15, 2015 at 10:04:10PM +0200, Andy Shevchenko wrote: > On Sun, Nov 15, 2015 at 8:39 PM, Dave Penkler wrote: snip > > + > > Redundant empty line. > ok > > > + data->iin_bTag = 2; > > Hmm??? Why 2? > A-ha, below I f

Re: [PATCH v4 5/5] Add ioctls to enable and disable local controls on an instrument

2015-11-18 Thread Dave Penkler
On Sun, Nov 15, 2015 at 10:10:35PM +0200, Andy Shevchenko wrote: > On Sun, Nov 15, 2015 at 8:40 PM, Dave Penkler wrote: > > These ioctls provide support for the USBTMC-USB488 control requests > > for REN_CONTROL, GO_TO_LOCAL and LOCAL_LOCKOUT > > > > + > &g

[PATCH v5 0/5] usb: usbtmc: Add support for missing functions in USBTMC-USB488 spec

2015-11-18 Thread Dave Penkler
compliant oscilloscope Dave Penkler (5): Implement an ioctl to support the USMTMC-USB488 READ_STATUS_BYTE operation. Add support for USBTMC USB488 SRQ notification with fasync Add support for receiving USBTMC USB488 SRQ notifications via poll/select Add ioctl to retrieve USBTMC-USB488

[PATCH v5 3/5] Add support for receiving USBTMC USB488 SRQ notifications via poll/select

2015-11-18 Thread Dave Penkler
Background: In many situations operations on multiple instruments need to be synchronized. poll/select provide a convenient way of waiting on a number of different instruments and other peripherals simultaneously. Signed-off-by: Dave Penkler --- drivers/usb/class/usbtmc.c | 23

[PATCH v5 4/5] Add ioctl to retrieve USBTMC-USB488 capabilities

2015-11-18 Thread Dave Penkler
This is a convenience function to obtain an instrument's capabilities from its file descriptor without having to access sysfs from the user program. Signed-off-by: Dave Penkler --- drivers/usb/class/usbtmc.c | 12 include/uapi/linux/usb/tmc.h | 21 ++--- 2

[PATCH v5 5/5] Add ioctls to enable and disable local controls on an instrument

2015-11-18 Thread Dave Penkler
These ioctls provide support for the USBTMC-USB488 control requests for REN_CONTROL, GO_TO_LOCAL and LOCAL_LOCKOUT Signed-off-by: Dave Penkler --- drivers/usb/class/usbtmc.c | 71 include/uapi/linux/usb/tmc.h | 6 2 files changed, 77

[PATCH v5 2/5] Add support for USBTMC USB488 SRQ notification with fasync

2015-11-18 Thread Dave Penkler
Background: By configuring an instrument's event status register various conditions can be reported via an SRQ notification. This complements the synchronous polling approach using the READ_STATUS_BYTE ioctl with an asynchronous notification. Signed-off-by: Dave Penkler --- drivers/usb/

[PATCH v5 1/5] Implement an ioctl to support the USMTMC-USB488 READ_STATUS_BYTE operation.

2015-11-18 Thread Dave Penkler
appropriate condition. This capability is referred to in instrument application notes on synchronizing acquisitions for other platforms. Signed-off-by: Dave Penkler --- drivers/usb/class/usbtmc.c | 212 +++ include/uapi/linux/usb/tmc.h | 2 + 2 files changed, 214

Re: [PATCH v5 5/5] Add ioctls to enable and disable local controls on an instrument

2015-11-22 Thread Dave Penkler
On Wed, Nov 18, 2015 at 11:41:30AM +0200, Andy Shevchenko wrote: > On Wed, Nov 18, 2015 at 10:38 AM, Dave Penkler wrote: > > These ioctls provide support for the USBTMC-USB488 control requests > > for REN_CONTROL, GO_TO_LOCAL and LOCAL_LOCKOUT > > Couple of comments below

Re: [PATCH v5 1/5] Implement an ioctl to support the USMTMC-USB488 READ_STATUS_BYTE operation.

2015-11-22 Thread Dave Penkler
On Wed, Nov 18, 2015 at 11:55:27AM +0200, Andy Shevchenko wrote: > On Wed, Nov 18, 2015 at 10:37 AM, Dave Penkler wrote: > > Background: > > When performing a read on an instrument that is executing a function > > that runs longer than the USB timeout the instrument may h

Re: [PATCH v5 5/5] Add ioctls to enable and disable local controls on an instrument

2015-11-25 Thread Dave Penkler
On Sun, Nov 22, 2015 at 12:36:53PM +0200, Andy Shevchenko wrote: > On Sun, Nov 22, 2015 at 10:51 AM, Dave Penkler wrote: > > On Wed, Nov 18, 2015 at 11:41:30AM +0200, Andy Shevchenko wrote: > >> On Wed, Nov 18, 2015 at 10:38 AM, Dave Penkler wrote: > > &

Re: [PATCH v5 1/5] Implement an ioctl to support the USMTMC-USB488 READ_STATUS_BYTE operation.

2015-11-25 Thread Dave Penkler
On Sun, Nov 22, 2015 at 12:32:41PM +0200, Andy Shevchenko wrote: > On Sun, Nov 22, 2015 at 11:19 AM, Dave Penkler wrote: > > On Wed, Nov 18, 2015 at 11:55:27AM +0200, Andy Shevchenko wrote: > >> On Wed, Nov 18, 2015 at 10:37 AM, Dave Penkler wrote: > > >

Re: [PATCH v5 1/5] Implement an ioctl to support the USMTMC-USB488 READ_STATUS_BYTE operation.

2015-11-28 Thread Dave Penkler
On Wed, Nov 25, 2015 at 10:38:39PM +0200, Andy Shevchenko wrote: > On Wed, Nov 25, 2015 at 11:18 AM, Dave Penkler wrote: > > On Sun, Nov 22, 2015 at 12:32:41PM +0200, Andy Shevchenko wrote: > >> On Sun, Nov 22, 2015 at 11:19 AM, Dave Penkler wrote: > >> > On Wed, No

Re: [PATCH v5 1/5] Implement an ioctl to support the USMTMC-USB488 READ_STATUS_BYTE operation.

2015-11-28 Thread Dave Penkler
On Sat, Nov 28, 2015 at 04:57:47PM +0200, Andy Shevchenko wrote: > On Sat, Nov 28, 2015 at 1:55 PM, Dave Penkler wrote: > > On Wed, Nov 25, 2015 at 10:38:39PM +0200, Andy Shevchenko wrote: > >> On Wed, Nov 25, 2015 at 11:18 AM, Dave Penkler wrote: > >> > On Sun, No

[PATCH v6 0/5] usb: usbtmc: Add support for missing functions in USBTMC-USB488 spec

2015-11-29 Thread Dave Penkler
- simplify some expressions v3 - Split into multiple patches as per gregkh request V2 - Fix V1 bug: not waking sleepers on disconnect. - Correct sparse warnings. V1 - Original patch Testing: All functions tested ok on an USBTMC-USB488 compliant oscilloscope Dave Penkler

[PATCH v6 1/5] Implement an ioctl to support the USMTMC-USB488 READ_STATUS_BYTE operation.

2015-11-29 Thread Dave Penkler
appropriate condition. This capability is referred to in instrument application notes on synchronizing acquisitions for other platforms. Signed-off-by: Dave Penkler --- drivers/usb/class/usbtmc.c | 200 +++ include/uapi/linux/usb/tmc.h | 2 + 2 files changed, 202

[PATCH v6 2/5] Add support for USBTMC USB488 SRQ notification with fasync

2015-11-29 Thread Dave Penkler
Background: By configuring an instrument's event status register various conditions can be reported via an SRQ notification. This complements the synchronous polling approach using the READ_STATUS_BYTE ioctl with an asynchronous notification. Signed-off-by: Dave Penkler --- drivers/usb/

[PATCH v6 3/5] Add support for receiving USBTMC USB488 SRQ notifications via poll/select

2015-11-29 Thread Dave Penkler
Background: In many situations operations on multiple instruments need to be synchronized. poll/select provide a convenient way of waiting on a number of different instruments and other peripherals simultaneously. Signed-off-by: Dave Penkler --- drivers/usb/class/usbtmc.c | 23

[PATCH v6 4/5] Add ioctl to retrieve USBTMC-USB488 capabilities

2015-11-29 Thread Dave Penkler
This is a convenience function to obtain an instrument's capabilities from its file descriptor without having to access sysfs from the user program. Signed-off-by: Dave Penkler --- drivers/usb/class/usbtmc.c | 12 include/uapi/linux/usb/tmc.h | 21 ++--- 2

[PATCH v6 5/5] Add ioctls to enable and disable local controls on an instrument

2015-11-29 Thread Dave Penkler
These ioctls provide support for the USBTMC-USB488 control requests for REN_CONTROL, GO_TO_LOCAL and LOCAL_LOCKOUT Signed-off-by: Dave Penkler --- drivers/usb/class/usbtmc.c | 71 include/uapi/linux/usb/tmc.h | 6 2 files changed, 77