aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/gadget.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/dwc3/gadget.c')
-rw-r--r--drivers/usb/dwc3/gadget.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 58fdfad96b4d..c2813c2b005a 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -263,8 +263,11 @@ void dwc3_gadget_giveback(struct dwc3_ep *dep, struct dwc3_request *req,
263 if (req->request.status == -EINPROGRESS) 263 if (req->request.status == -EINPROGRESS)
264 req->request.status = status; 264 req->request.status = status;
265 265
266 usb_gadget_unmap_request(&dwc->gadget, &req->request, 266 if (dwc->ep0_bounced && dep->number == 0)
267 req->direction); 267 dwc->ep0_bounced = false;
268 else
269 usb_gadget_unmap_request(&dwc->gadget, &req->request,
270 req->direction);
268 271
269 dev_dbg(dwc->dev, "request %p from %s completed %d/%d ===> %d\n", 272 dev_dbg(dwc->dev, "request %p from %s completed %d/%d ===> %d\n",
270 req, dep->name, req->request.actual, 273 req, dep->name, req->request.actual,
@@ -1026,6 +1029,7 @@ static void __dwc3_gadget_start_isoc(struct dwc3 *dwc,
1026 if (list_empty(&dep->request_list)) { 1029 if (list_empty(&dep->request_list)) {
1027 dev_vdbg(dwc->dev, "ISOC ep %s run out for requests.\n", 1030 dev_vdbg(dwc->dev, "ISOC ep %s run out for requests.\n",
1028 dep->name); 1031 dep->name);
1032 dep->flags |= DWC3_EP_PENDING_REQUEST;
1029 return; 1033 return;
1030 } 1034 }
1031 1035
@@ -1089,6 +1093,17 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
1089 if (dep->flags & DWC3_EP_PENDING_REQUEST) { 1093 if (dep->flags & DWC3_EP_PENDING_REQUEST) {
1090 int ret; 1094 int ret;
1091 1095
1096 /*
1097 * If xfernotready is already elapsed and it is a case
1098 * of isoc transfer, then issue END TRANSFER, so that
1099 * you can receive xfernotready again and can have
1100 * notion of current microframe.
1101 */
1102 if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) {
1103 dwc3_stop_active_transfer(dwc, dep->number);
1104 return 0;
1105 }
1106
1092 ret = __dwc3_gadget_kick_transfer(dep, 0, true); 1107 ret = __dwc3_gadget_kick_transfer(dep, 0, true);
1093 if (ret && ret != -EBUSY) { 1108 if (ret && ret != -EBUSY) {
1094 struct dwc3 *dwc = dep->dwc; 1109 struct dwc3 *dwc = dep->dwc;