From: Hans de Goede <hdegoede@redhat.com>
To: Amit Virdi <amit.virdi@st.com>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: gregkh@linuxfoundation.org, stern@rowland.harvard.edu,
rdunlap@infradead.org, ming.lei@canonical.com,
hsi-ss-sw-devel@lists.codex.cro.st.com
Subject: Re: [PATCH] usb: core: allow zero packet flag for interrupt urbs
Date: Thu, 17 Jul 2014 12:43:18 +0200 [thread overview]
Message-ID: <53C7A8C6.3010001@redhat.com> (raw)
In-Reply-To: <5255a576a562f60c185e89b5937357290242fe1e.1405586653.git.amit.virdi@st.com>
Hi,
On 07/17/2014 10:47 AM, Amit Virdi wrote:
> Section 4.4.7.2 of the USB3.0 spec says:
> A zero-length data payload is a valid transfer and may be useful for
> some implementations.
>
> So, extend the logic of allowing URB_ZERO_PACKET to interrupt urbs too.
> Otherwise, the kernel throws error of BOGUS transfer flags.
>
> Signed-off-by: Amit Virdi <amit.virdi@st.com>
Seems sensible to me:
Acked-by: Hans de Goede <hdegoede@redhat.com>
Regards,
Hans
> ---
> drivers/usb/core/urb.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c
> index 991386c..a136246 100644
> --- a/drivers/usb/core/urb.c
> +++ b/drivers/usb/core/urb.c
> @@ -460,6 +460,10 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
> case USB_ENDPOINT_XFER_CONTROL:
> allowed |= URB_NO_FSBR; /* only affects UHCI */
> /* FALLTHROUGH */
> + case USB_ENDPOINT_XFER_INT:
> + if (is_out)
> + allowed |= URB_ZERO_PACKET;
> + /* FALLTHROUGH */
> default: /* all non-iso endpoints */
> if (!is_out)
> allowed |= URB_SHORT_NOT_OK;
>
next prev parent reply other threads:[~2014-07-17 10:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-17 8:47 [PATCH] usb: core: allow zero packet flag for interrupt urbs Amit Virdi
2014-07-17 10:43 ` Hans de Goede [this message]
2014-07-17 14:55 ` Alan Stern
2014-07-17 17:59 ` Steve Calfee
2014-07-17 19:32 ` Alan Stern
2014-07-17 20:59 ` Steve Calfee
2014-07-18 14:34 ` Alan Stern
2014-07-18 11:56 ` Amit Virdi
2014-07-18 14:39 ` Alan Stern
2014-07-21 5:07 ` Amit Virdi
2014-07-21 5:16 ` [PATCH V2] " Amit Virdi
2014-07-21 14:06 ` Alan Stern
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=53C7A8C6.3010001@redhat.com \
--to=hdegoede@redhat.com \
--cc=amit.virdi@st.com \
--cc=gregkh@linuxfoundation.org \
--cc=hsi-ss-sw-devel@lists.codex.cro.st.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=ming.lei@canonical.com \
--cc=rdunlap@infradead.org \
--cc=stern@rowland.harvard.edu \
/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