mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Dave Penkler <dpenkler@gmail.com>
Cc: peter.chen@freescale.com, teuniz@gmail.com,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 1/5] Implement an ioctl to support the USMTMC-USB488 READ_STATUS_BYTE operation.
Date: Sun, 24 Jan 2016 20:43:54 -0800	[thread overview]
Message-ID: <20160125044354.GB14247@kroah.com> (raw)
In-Reply-To: <20151129122849.GA7499@slacky>

On Sun, Nov 29, 2015 at 01:28:49PM +0100, 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 hang and
> require a device reset to recover. The READ_STATUS_BYTE operation
> always returns even when the instrument is busy permitting to poll
> for the appropriate condition. This capability is referred to in
> instrument application notes on synchronizing acquisitions for other
> platforms.
> 
> Signed-off-by: Dave Penkler <dpenkler@gmail.com>
> ---
>  drivers/usb/class/usbtmc.c   | 200 +++++++++++++++++++++++++++++++++++++++++++
>  include/uapi/linux/usb/tmc.h |   2 +
>  2 files changed, 202 insertions(+)
> 
> diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
> index 7a11a82..89456df9 100644
> --- a/drivers/usb/class/usbtmc.c
> +++ b/drivers/usb/class/usbtmc.c
> @@ -87,6 +87,19 @@ struct usbtmc_device_data {
>  	u8 bTag_last_write;	/* needed for abort */
>  	u8 bTag_last_read;	/* needed for abort */
>  
> +	/* data for interrupt in endpoint handling */
> +	u8             bNotify1;
> +	u8             bNotify2;
> +	u16            ifnum;
> +	u8             iin_bTag;
> +	u8            *iin_buffer;
> +	atomic_t       iin_data_valid;
> +	unsigned int   iin_ep;
> +	int            iin_ep_present;
> +	int            iin_interval;
> +	struct urb    *iin_urb;
> +	u16            iin_wMaxPacketSize;
> +
>  	u8 rigol_quirk;
>  
>  	/* attributes from the USB TMC spec for this device */
> @@ -99,6 +112,7 @@ struct usbtmc_device_data {
>  	struct usbtmc_dev_capabilities	capabilities;
>  	struct kref kref;
>  	struct mutex io_mutex;	/* only one i/o function running at a time */
> +	wait_queue_head_t waitq;
>  };
>  #define to_usbtmc_data(d) container_of(d, struct usbtmc_device_data, kref)
>  
> @@ -373,6 +387,83 @@ exit:
>  	return rv;
>  }
>  
> +static int usbtmc488_ioctl_read_stb(struct usbtmc_device_data *data,
> +				unsigned long arg)

Minor nit, make arg be a "void __user *" here, then there is no need to
cast it later on.

thanks,

greg k-h

  reply	other threads:[~2016-01-25  4:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-29 12:22 [PATCH v6 0/5] usb: usbtmc: Add support for missing functions in USBTMC-USB488 spec Dave Penkler
2015-11-29 12:28 ` [PATCH v6 1/5] Implement an ioctl to support the USMTMC-USB488 READ_STATUS_BYTE operation Dave Penkler
2016-01-25  4:43   ` Greg KH [this message]
2015-11-29 12:30 ` [PATCH v6 2/5] Add support for USBTMC USB488 SRQ notification with fasync Dave Penkler
2015-11-29 12:34 ` [PATCH v6 3/5] Add support for receiving USBTMC USB488 SRQ notifications via poll/select Dave Penkler
2015-11-29 12:35 ` [PATCH v6 4/5] Add ioctl to retrieve USBTMC-USB488 capabilities Dave Penkler
2016-01-25  4:42   ` Greg KH
2016-01-26 18:15     ` Dave Penkler
2015-11-29 12:37 ` [PATCH v6 5/5] Add ioctls to enable and disable local controls on an instrument Dave Penkler
2016-01-25  4:47   ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160125044354.GB14247@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=dpenkler@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter.chen@freescale.com \
    --cc=teuniz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome