public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: dwc3: gadget: giveback request if start transfer fail
@ 2014-05-01  6:36 Zhuang Jin Can
  2014-04-30 19:58 ` Felipe Balbi
  0 siblings, 1 reply; 6+ messages in thread
From: Zhuang Jin Can @ 2014-05-01  6:36 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: linux-usb, linux-omap, linux-kernel

At least we should giveback the current request to the
gadget. Otherwise, the gadget will be stuck without knowing
anything.

It was oberved that the failure can happen if the request is
queued when the run/stop bit of controller is not set.

Signed-off-by: Zhuang Jin Can <jin.can.zhuang@intel.com>
---
 drivers/usb/dwc3/gadget.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 70715ee..8d0c3c7 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1000,9 +1000,7 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep, u16 cmd_param,
 		 * here and stop, unmap, free and del each of the linked
 		 * requests instead of what we do now.
 		 */
-		usb_gadget_unmap_request(&dwc->gadget, &req->request,
-				req->direction);
-		list_del(&req->list);
+		dwc3_gadget_giveback(dep, req, -ESHUTDOWN);
 		return ret;
 	}
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-05-02 16:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-01  6:36 [PATCH] usb: dwc3: gadget: giveback request if start transfer fail Zhuang Jin Can
2014-04-30 19:58 ` Felipe Balbi
2014-05-01 20:44   ` Zhuang Jin Can
2014-05-01 15:13     ` Felipe Balbi
2014-05-03  4:05       ` Zhuang Jin Can
2014-05-02 16:10         ` Felipe Balbi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox