From 5dc4538bf3fea0baf4ca2e4191e0e62991fbd779 Mon Sep 17 00:00:00 2001 From: Marek Szyprowski Date: Tue, 3 Mar 2015 17:32:10 +0100 Subject: 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 --- drivers/usb/dwc3/gadget.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/usb/dwc3') 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. -- cgit v1.1