public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: core: allow zero packet flag for interrupt urbs
@ 2014-07-17  8:47 Amit Virdi
  2014-07-17 10:43 ` Hans de Goede
  2014-07-17 14:55 ` Alan Stern
  0 siblings, 2 replies; 12+ messages in thread
From: Amit Virdi @ 2014-07-17  8:47 UTC (permalink / raw)
  To: linux-usb, linux-kernel
  Cc: gregkh, stern, rdunlap, ming.lei, hdegoede, hsi-ss-sw-devel,
	Amit Virdi

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>
---
 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;
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-07-21 14:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox