Re: [PATCH] usb: musb: host: clear stale TT buffers after aborted transfers
From: Greg Kroah-Hartman
Date: Fri Nov 20 2026 - 09:06:31 EST
On Tue, Nov 03, 2026 at 04:03:33PM -0300, Jhon Wilker Rodrigues Aquino wrote:
> From: Jhon Wilker Rodrigues Aquino <jhon.aquino@xxxxxxxxxxxxxxx>
>
> On AM335x with MUSB and a Microchip USB2514 hub, disconnecting a
> full-speed CDC ACM device during bulk traffic can leave its TT unable
> to enumerate full-speed devices. High-speed devices still work, and
> Reset_TT restores operation.
>
> Queue Clear-TT-Buffer for failed or unlinked control and bulk URBs
> behind an external TT. Park the affected endpoint queue until the
> asynchronous clear completes, so new URBs cannot use a buffer being
> cleared. Keep the parked queue alive until the callback finishes,
> including during endpoint disable.
>
> Signed-off-by: Jhon Wilker Rodrigues Aquino <jhonwilker0112@xxxxxxxxx>
> ---
> drivers/usb/musb/musb_host.c | 166 +++++++++++++++++++++++++++++++----
> drivers/usb/musb/musb_host.h | 2 +
> 2 files changed, 152 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
> index 31b0612489911..6e8cf462676ec 100644
> --- a/drivers/usb/musb/musb_host.c
> +++ b/drivers/usb/musb/musb_host.c
> @@ -22,6 +22,11 @@
> #include "musb_host.h"
> #include "musb_trace.h"
>
> +static bool tt_clear = true;
> +module_param(tt_clear, bool, 0644);
> +MODULE_PARM_DESC(tt_clear,
> + "Clear hub TT buffers after failed or unlinked control/bulk transfers (default Y; set N only for A/B comparison or if a hub mishandles CLEAR_TT_BUFFER; affects new requests only)");
> +
No, this isn't the 1990's, we should not add new module parameters as
they will not work well over time.
Do this automatically please, a user should never have to know how to
pick this.
thanks,
greg k-h