[PATCH] usb: gadget: fastboot: avoid stale IN dequeue
Marek Vasut
marek.vasut at mailbox.org
Sun May 31 15:22:49 CEST 2026
On 5/31/26 9:01 AM, Sam Day wrote:
> This usb_ep_dequeue line was originally added as a fix specifically for
> MUSB UDCs.
>
> On dwc3, it causes an error like this to be logged:
>
> ```
> dwc3-generic-peripheral usb at a600000: request 000000016e0862
> c0 was not queued to ep1in-bulk
> ```
>
> The trouble is, this causes an infinite loop in `fastboot oem console`.
> Every time it flushes out a response with a chunk of the console, it
> triggers another instance of this error, which means another response
> must be written, which generates the error, and so on.
>
> I'm not sure if the MUSB gadget code still needs this workaround, so to
> be safe I opted not to remove it, but guard it with
> CONFIG_USB_MUSB_GADGET instead.
>
> Signed-off-by: Sam Day <me at samcday.com>
> ---
> drivers/usb/gadget/f_fastboot.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
> index 8df0e3f331d..fb7e47401ca 100644
> --- a/drivers/usb/gadget/f_fastboot.c
> +++ b/drivers/usb/gadget/f_fastboot.c
> @@ -406,7 +406,8 @@ static int fastboot_tx_write(const char *buffer, unsigned int buffer_size)
> memcpy(in_req->buf, buffer, buffer_size);
> in_req->length = buffer_size;
>
> - usb_ep_dequeue(fastboot_func->in_ep, in_req);
> + if (IS_ENABLED(CONFIG_USB_MUSB_GADGET))
> + usb_ep_dequeue(fastboot_func->in_ep, in_req);
This won't work on systems that have multiple disparate USB controllers.
Why was the workaround added in the first place ?
More information about the U-Boot
mailing list