[U-Boot] [PATCH 08/14] usb: dwc3: add a workaround for too small OUT requests

Lukasz Majewski l.majewski at samsung.com
Tue Mar 3 17:32:10 CET 2015


From: Marek Szyprowski <m.szyprowski at samsung.com>

DWC3 hangs on OUT requests smaller than maxpacket size,
so HACK the request length to be at least equal to maxpacket size.

Signed-off-by: Marek Szyprowski <m.szyprowski at samsung.com>
---
 drivers/usb/dwc3/gadget.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index a497fbb..737cb3e 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -973,6 +973,14 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
 	req->epnum		= dep->number;
 
 	/*
+	 * DWC3 hangs on OUT requests smaller than maxpacket size,
+	 * so HACK the request length
+	 */
+	if (dep->direction == 0 &&
+	    req->request.length < dep->endpoint.maxpacket)
+		req->request.length = dep->endpoint.maxpacket;
+
+	/*
 	 * We only add to our list of requests now and
 	 * start consuming the list once we get XferNotReady
 	 * IRQ.
-- 
2.0.0.rc2



More information about the U-Boot mailing list