diff options
author | Felipe Balbi <balbi@ti.com> | 2011-09-08 17:17:12 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2011-09-09 12:05:28 +0200 |
commit | d742220b357769fa0a764d238373b8667116cf64 (patch) | |
tree | e9a115381c22ab17df21203181051629c56c5dd0 | |
parent | usb: dwc3: gadget: drop the useless dma_sync_single* calls (diff) | |
download | linux-d742220b357769fa0a764d238373b8667116cf64.tar.xz linux-d742220b357769fa0a764d238373b8667116cf64.zip |
usb: dwc3: ep0: giveback requests on stall_and_restart
if we don't, the list will be busy forever.
Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r-- | drivers/usb/dwc3/ep0.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index 48d3770bd765..4cc72fdc0575 100644 --- a/drivers/usb/dwc3/ep0.c +++ b/drivers/usb/dwc3/ep0.c @@ -214,9 +214,19 @@ out: static void dwc3_ep0_stall_and_restart(struct dwc3 *dwc) { + struct dwc3_ep *dep = dwc->eps[0]; + /* stall is always issued on EP0 */ __dwc3_gadget_ep_set_halt(dwc->eps[0], 1); dwc->eps[0]->flags = DWC3_EP_ENABLED; + + if (!list_empty(&dep->request_list)) { + struct dwc3_request *req; + + req = next_request(&dep->request_list); + dwc3_gadget_giveback(dep, req, -ECONNRESET); + } + dwc->ep0state = EP0_SETUP_PHASE; dwc3_ep0_out_start(dwc); } |