[RFC PATCH 0/2] fix xhci endpoint restart at EPROTO

Mathias Nyman
2026-03-23T12:28:08Z

Hi

These patches are related to the 'correctly handling EPROTO' discussion,
and aim to fix the xhci endpoint automatic restart issue.

It also makes sure that multi TD URBs are given back with proper
EPROTO/EPIPE status if a stall/transaction error is triggered on
any TD of the URB, not just the last one.

endpoints will still be restarted when a new URB is queued, this does
not fix the issue with BH URBs completion, but will print a debug message
if a new URB is queued before previous 'tainted' pending URBs are cancelled.

I haven't been able to test the actual codepaths in these patches yet.
Can't easily queue several URBs and somehow trigger stall or transaction
error on early URBs, but would like to get feeback on this solution early.

Thanks
Mathias

Mathias Nyman (2):
xhci: prevent automatic endpoint restart after stall or error
xhci: Ensure URB is given back when endpoint halts on a multi-TD URB

drivers/usb/host/xhci-ring.c | 50 +++++++++++++++++++++++++++++++-----
drivers/usb/host/xhci.c | 7 +++++
drivers/usb/host/xhci.h | 4 ++-
3 files changed, 53 insertions(+), 8 deletions(-)

--
2.43.0