summary refs log tree commit diff
path: root/drivers/usb/dwc3
diff options
context:
space:
mode:
authorPratyush Anand <pratyush.anand@st.com>2012-06-15 11:54:36 +0530
committerFelipe Balbi <balbi@ti.com>2012-06-15 14:43:44 +0300
commit1591633ed6c4c3994944f31ddb59bc072a2ed0ca (patch)
treeda7f53396443065797f8be878ba4186a74b3fbf3 /drivers/usb/dwc3
parentdcae3573b98b2205961bfa5821427f5664422cd8 (diff)
downloadlinux-1591633ed6c4c3994944f31ddb59bc072a2ed0ca.tar.gz
usb: dwc3: giveback all queued request when ep disabled or reset received
In case of ep_disable and reset interrupt is received and, still there
was at least one request queued for dma transfer, then endpoint is
stopped first. Once endpoint is stopped, callback for all queued
request must be called.

Signed-off-by: Pratyush Anand <pratyush.anand@st.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r--drivers/usb/dwc3/gadget.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 38cd13ffae9d..f6fb42da2e64 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -579,8 +579,11 @@ static void dwc3_remove_requests(struct dwc3 *dwc, struct dwc3_ep *dep)
 		 */
 		udelay(100);
 
-		req = next_request(&dep->req_queued);
-		dwc3_gadget_giveback(dep, req, -ESHUTDOWN);
+		while (!list_empty(&dep->req_queued)) {
+			req = next_request(&dep->req_queued);
+
+			dwc3_gadget_giveback(dep, req, -ESHUTDOWN);
+		}
 	}
 
 	while (!list_empty(&dep->request_list)) {