Re: [RFC PATCH 1/2] xhci: prevent automatic endpoint restart after stall or error

Alan Stern
2026-04-07T15:23:38Z

It's been a while now, and nobody has objected to the proposed plan for
handling this issue, so I'm going to assume that everyone is on board
with the idea.

There is a loose end still to be straightened out. It concerns handling
of -EREMOTEIO errors (short packet received with URB_SHORT_NOT_OK set).
While some HCDs -- especially those supporting SG -- may not stop the
endpoint queue when this error occurs, other HCDs will do so. The
question is how the core should tell them to start it up again. This
shouldn't happen until after the completion handler returns.

Short packets don't cause any loss of synchronization between the
endpoint state on the host and on the device, so -EREMOTEIO doesn't
require usb_clear_halt() or usb_reset_endpoint() for recovery. This
means we need to find some other way to tell the HCD when the queue can
restart. Should we create a new hc_driver callback specifically for
this purpose?

Related question: Although URB_SHORT_NOT_OK is allowed for all types of
IN URB other than isochronous, does its queue-stopping property make
sense for control or interrupt URBs? As far as I know, no kernel code
uses it for them, although some userspace code might (via usbfs).

Alan Stern