xhci: handle isoc Babble and Buffer Overrun events properly
[platform/kernel/linux-starfive.git] / drivers / usb / host / xhci-ring.c
index bd7b541..c410a98 100644 (file)
@@ -2395,9 +2395,13 @@ static int process_isoc_td(struct xhci_hcd *xhci, struct xhci_virt_ep *ep,
        case COMP_BANDWIDTH_OVERRUN_ERROR:
                frame->status = -ECOMM;
                break;
-       case COMP_ISOCH_BUFFER_OVERRUN:
        case COMP_BABBLE_DETECTED_ERROR:
+               sum_trbs_for_length = true;
+               fallthrough;
+       case COMP_ISOCH_BUFFER_OVERRUN:
                frame->status = -EOVERFLOW;
+               if (ep_trb != td->last_trb)
+                       td->error_mid_td = true;
                break;
        case COMP_INCOMPATIBLE_DEVICE_ERROR:
        case COMP_STALL_ERROR: