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

From: Julian Oes

Date: Tue Sep 01 2026 - 18:48:24 EST


On Tue, Sep 01, 2026 at 06:33:15AM +0200, Greg Kroah-Hartman wrote:
> This sounds like a broken hub, why not just replace that? It shouldn't
> be causing transactions on a different port to stop.

I agree that ideally my hub would not do that. However, my assumption is
that it's not my specific hub that is broken, but that this hub (or
other hubs on the same chip) have that sort of issue, and I was hoping
to be able to fix it for me and others in software, rather than brush it
off as a hardware issue.

>From what I understand an endpoint halt is spec-defined as
host-recoverable. In the current state (without the patch) the read
never returns data again and the user doesn't know that it needs
restarting.

My patch is meant to do the same pattern that cdc-acm already does:
EVENT_RX_STALL → kill → usb_clear_halt → resubmit.

> > +#define USB_SERIAL_STALL_COOLDOWN msecs_to_jiffies(10)
>
> control or bulk? This comment does not make much sense.

Sorry, it's not clear. Both: the halted endpoint is the bulk-in one,
but the CLEAR_FEATURE that clears it goes to the control pipe, so one
recovery attempt is a control transfer plus a bulk resubmit.

Without the delay I saw six stalls in six milliseconds. The clear-halt
succeeds every time, but the hub re-stalls the endpoint as soon as a
read is queued, until the transient is over.

The delay is there to stop that becoming a tight loop.

I can reword it for v3, depending on whether you agree that a stall
needs clearing at all.

For a bit of context: in the past 14 years, I have been working with
various FTDI and similar USB devices, and it's possible that I have seen
this issue every so often. Usually, I would just re-open screen, try a
different USB port or hub, restart the hub, etc. It's only this time
that I stumbled on a reproducible case, and had the capacity to dig
deeper using an LLM.

I have been using the v1 patch that I submitted in May ever since and
have not noticed such issues anymore.

Thanks,
Julian