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>
This commit is contained in:
Marek Szyprowski 2015-03-03 17:32:10 +01:00 committed by Marek Vasut
parent 7e9cb7962f
commit 5dc4538bf3

View File

@ -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