Re: [PATCH v2] USB: serial: generic: recover from a stalled bulk-in endpoint

From: Greg Kroah-Hartman

Date: Tue Sep 01 2026 - 00:33:26 EST


On Tue, Sep 01, 2026 at 03:49:49PM +1200, Julian Oes wrote:
> A USB serial port can go permanently silent when its bulk-in endpoint is
> halted: the read URBs complete with -EPIPE, which the generic read
> callback has always treated as fatal, and no further data arrives until
> user space closes and reopens the tty.

Which is good, as the device is obviously broken at that point in time :)

> Recovery from a halted bulk endpoint is CLEAR_FEATURE(ENDPOINT_HALT)
> followed by resubmission of the reads. That needs a control transfer, so
> defer it to a work item as cdc-acm already does.
>
> Use a dedicated work item rather than the existing per-port work.

Ok, this is just llm-generated text. Please rewrite this in your own
words.

> The
> latter is scheduled from every write completion and must not be
> cancelled on close, as the line discipline depends on it. Stall
> recovery resubmits the read URBs and must therefore be cancelled
> wherever the reads are stopped, that is, on close, suspend and
> disconnect.
>
> Schedule the recovery with a short cooldown. The stall can persist for a
> few milliseconds, during which the resubmitted URBs stall again as soon
> as they are queued; without a delay the recovery becomes a busy loop of
> control transfers. Rate-limit the stall message for the same reason, as
> a stall is now a recurring condition rather than a terminal one.
>
> I ran into this with an FTDI FT231X behind a hub that halts the
> adapter's bulk-in endpoint whenever an unrelated CDC ACM device on a
> sibling port is disconnected. With this change the FTDI port keeps
> receiving data across such an event.

This sounds like a broken hub, why not just replace that? It shouldn't
be causing transactions on a different port to stop.

> +/*
> + * Cooldown between attempts to recover a stalled bulk-in endpoint. A stall
> + * caused by a transient fault can persist for a few milliseconds, during which
> + * the resubmitted URBs stall again immediately. Back off a little so that a
> + * persistently halted endpoint is not hammered with control transfers.
> + */
> +#define USB_SERIAL_STALL_COOLDOWN msecs_to_jiffies(10)

control or bulk? This comment does not make much sense.

thanks,

greg k-h