Re: [PATCH v4 1/1] xhci: Correctly handle last TRB of isoc TD on Etron xHCI host
From: Michał Pecio
Date: Wed Feb 05 2025 - 16:45:29 EST
> case COMP_STOPPED:
> + /* Think of it as the final event if TD had an error */
> + if (td->error_mid_td)
> + td->error_mid_td = false;
> sum_trbs_for_length = true;
> break;
What was the reason for this part?
As written it is going to cause problems, the driver will forget about
earlier errors if the endpoint is stopped and resumed on the same TD.
I think that the whole patch could be much simpler, like:
case X_ERROR:
frame->status = X;
td->error_mid_td = true;
break;
case Y_ERROR:
frame->status = Y;
td->error_mid_td = true;
break;
and then
if (error_mid_td && (ep_trb != td->end_trb || ETRON && SUPERSPEED)) {
// error mid TD, wait for final event
}
finish_td()
Regards,
Michal