From: Marek Szyprowski Date: Tue, 3 Mar 2015 16:32:10 +0000 (+0100) Subject: usb: dwc3: add a workaround for too small OUT requests X-Git-Tag: submit/tizen/20160318.071304~162 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=71bb266512ae02b3de0bb26e7de84ab057408cd7;p=profile%2Fcommon%2Fplatform%2Fkernel%2Fu-boot-artik.git 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 --- diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index de4d90859..7c342c63e 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -974,6 +974,14 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req) req->direction = dep->direction; 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