@@ -2966,9 +2966,6 @@ static int xhci_handle_event(struct xhci_hcd *xhci, struct xhci_interrupter *ir)
return 0;
}
- /* Update SW event ring dequeue pointer */
- inc_deq(xhci, ir->event_ring);
-
/* Are there more items on the event ring? Caller will call us again to
* check.
*/
@@ -3091,15 +3088,21 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd)
* that clears the EHB.
*/
while (xhci_handle_event(xhci, ir) > 0) {
- if (event_loop++ < TRBS_PER_SEGMENT / 2)
- continue;
- xhci_update_erst_dequeue(xhci, ir, false);
+ /*
+ * If half a segment of events have been handled in one go then
+ * update ERDP, and force isoc trbs to interrupt more often
+ */
+ if (event_loop++ > TRBS_PER_SEGMENT / 2) {
+ xhci_update_erst_dequeue(xhci, ir, false);
+
+ if (ir->isoc_bei_interval > AVOID_BEI_INTERVAL_MIN)
+ ir->isoc_bei_interval = ir->isoc_bei_interval / 2;
- /* ring is half-full, force isoc trbs to interrupt more often */
- if (ir->isoc_bei_interval > AVOID_BEI_INTERVAL_MIN)
- ir->isoc_bei_interval = ir->isoc_bei_interval / 2;
+ event_loop = 0;
+ }
- event_loop = 0;
+ /* Update SW event ring dequeue pointer */
+ inc_deq(xhci, ir->event_ring);
}
xhci_update_erst_dequeue(xhci, ir, true);