summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2015-03-03 17:32:10 +0100
committerMarek Vasut <marex@denx.de>2015-04-14 05:48:12 +0200
commit5dc4538bf3fea0baf4ca2e4191e0e62991fbd779 (patch)
tree7e1eca9ac3823c36cf93a7a8af46e21cc45a60b9
parent7e9cb7962f401439c9f107878100810b138f6ab9 (diff)
downloadu-boot-imx-5dc4538bf3fea0baf4ca2e4191e0e62991fbd779.zip
u-boot-imx-5dc4538bf3fea0baf4ca2e4191e0e62991fbd779.tar.gz
u-boot-imx-5dc4538bf3fea0baf4ca2e4191e0e62991fbd779.tar.bz2
usb: dwc3: add a workaround for too small OUT requests
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@samsung.com>
-rw-r--r--drivers/usb/dwc3/gadget.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index de4d908..7c342c6 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -975,6 +975,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.