[PATCH] usb: gadget: fastboot: avoid stale IN dequeue

Sam Day me at samcday.com
Sun May 31 09:01:59 CEST 2026


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);
 
 	ret = usb_ep_queue(fastboot_func->in_ep, in_req, 0);
 	if (ret)

---
base-commit: 30b77f6aa146c96b831cb4ece038130b655b6a41
change-id: 20260531-dwc3-fastboot-fix-4f345f8b65dd

Best regards,
-- 
Sam Day <me at samcday.com>




More information about the U-Boot mailing list