summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/gadget.c
diff options
context:
space:
mode:
authorFelipe Balbi <felipe.balbi@linux.intel.com>2018-03-29 12:49:28 +0300
committerFelipe Balbi <felipe.balbi@linux.intel.com>2018-05-21 10:00:53 +0300
commit6d8a019614f3a7630e0a2c1be4bf1cfc23acf56e (patch)
tree7fb62812df076b56d4382408e1bcd7e2977b04c9 /drivers/usb/dwc3/gadget.c
parent58f0218a271d297487aff56b0982a032c8ea35b3 (diff)
downloadop-kernel-dev-6d8a019614f3a7630e0a2c1be4bf1cfc23acf56e.zip
op-kernel-dev-6d8a019614f3a7630e0a2c1be4bf1cfc23acf56e.tar.gz
usb: dwc3: gadget: check for Missed Isoc from event status
In case we get an event with status set to Missed Isoc, this means we have missed an isochronous interval and should issue End Transfer command and wait for the following XferNotReady. Let's do that early, rather than late. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc3/gadget.c')
-rw-r--r--drivers/usb/dwc3/gadget.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 4e2bef9..d378f3e 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2396,9 +2396,6 @@ static void dwc3_gadget_ep_cleanup_completed_requests(struct dwc3_ep *dep,
* entry is added into request list.
*/
dep->flags = DWC3_EP_PENDING_REQUEST;
- } else {
- dwc3_stop_active_transfer(dep, true);
- dep->flags = DWC3_EP_ENABLED;
}
}
}
@@ -2418,14 +2415,25 @@ static void dwc3_gadget_endpoint_transfer_in_progress(struct dwc3_ep *dep,
{
struct dwc3 *dwc = dep->dwc;
unsigned status = 0;
+ bool stop = false;
dwc3_gadget_endpoint_frame_from_event(dep, event);
if (event->status & DEPEVT_STATUS_BUSERR)
status = -ECONNRESET;
+ if (event->status & DEPEVT_STATUS_MISSED_ISOC) {
+ status = -EXDEV;
+ stop = true;
+ }
+
dwc3_gadget_ep_cleanup_completed_requests(dep, event, status);
+ if (stop) {
+ dwc3_stop_active_transfer(dep, true);
+ dep->flags = DWC3_EP_ENABLED;
+ }
+
/*
* WORKAROUND: This is the 2nd half of U1/U2 -> U0 workaround.
* See dwc3_gadget_linksts_change_interrupt() for 1st half.
OpenPOWER on IntegriCloud