Hi, On Thu, Feb 28, 2013 at 04:05:31PM +0530, Pratyush Anand wrote: > To reproduce the issue: > > -- Gadget dequeues all submitted requests to the endpoint. > -- Some of them was not even queued to the dwc3 core. > -- Such requests will never complete and a transfer completion interrupt > for them will never be received. > -- In such situation, we will not be clearing DWC3_EP_BUSY flag, even > when there is no request queued to dwc3 core. > -- Now gadget queues a request to the one endpoint say (BULK IN) > -- It is added into dep->request_list > -- Host sends an IN token > -- Core responds with NAK and generates xfernotready > -- Since DWC3_EP_BUSY is still set, so this request will never reach to > core (dep->req_queued) > > This patch clears DWC3_EP_BUSY during ep_dequeue if none of the request > was in dep->req_queued. > > Reported-by: Eric Tomio <eric.tomio@xxxxxx> > Signed-off-by: Pratyush Anand <pratyush.anand@xxxxxx> > --- > drivers/usb/dwc3/gadget.c | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c > index c8f0765..0acf1a1 100644 > --- a/drivers/usb/dwc3/gadget.c > +++ b/drivers/usb/dwc3/gadget.c > @@ -1219,6 +1219,8 @@ out1: > /* giveback the request */ > dwc3_gadget_giveback(dep, req, -ECONNRESET); > > + if (list_empty(&dep->req_queued)) > + dep->flags &= ~DWC3_EP_BUSY; not sure this is correct. Whenever req_queue isn't empty, we call dwc3_stop_active_transfer() which will clear DWC3_EP_BUSY flag. I guess bug is elsewhere. -- balbi
Attachment:
signature.asc
Description: Digital signature