summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZixun LI <[email protected]>2026-05-15 12:05:41 +0200
committerMattijs Korpershoek <[email protected]>2026-05-20 12:09:29 +0200
commit7f34bb50a59804f6ebe02c1f62b7b29093eb103c (patch)
treed74f63a28b11a98f584d0de30ed05d3fcfaf94fa
parentc8f68234422b8afb516fea2336b678750f10ba5b (diff)
usb: gadget: atmel: do not disable endpoints in reset_all_endpoints()
Endpoints should not be disabled on bus reset inside UDC driver, otherwise a race condition will happen between gadget driver. Gadget driver will free the requests and disable endpoints in disconnect ops. Also remove outdated comment about it in usba_ep_disable(). Signed-off-by: Zixun LI <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]> Fixes: 59310d1ecb9f ("usb: gadget: introduce 'enabled' flag in struct usb_ep") Link: https://patch.msgid.link/[email protected] [mkorpershoek: removed empty newline between Fixes: and sob] Signed-off-by: Mattijs Korpershoek <[email protected]>
-rw-r--r--drivers/usb/gadget/atmel_usba_udc.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
index f7a92ded6da..a2eee2bca2c 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -289,10 +289,6 @@ static int usba_ep_disable(struct usb_ep *_ep)
if (!ep->desc) {
spin_unlock_irqrestore(&udc->lock, flags);
- /* REVISIT because this driver disables endpoints in
- * reset_all_endpoints() before calling disconnect(),
- * most gadget drivers would trigger this non-error ...
- */
if (udc->gadget.speed != USB_SPEED_UNKNOWN)
DBG(DBG_ERR, "ep_disable: %s not enabled\n",
ep->ep.name);
@@ -571,20 +567,6 @@ static void reset_all_endpoints(struct usba_udc *udc)
list_del_init(&req->queue);
request_complete(ep, req, -ECONNRESET);
}
-
- /* NOTE: normally, the next call to the gadget driver is in
- * charge of disabling endpoints... usually disconnect().
- * The exception would be entering a high speed test mode.
- *
- * FIXME remove this code ... and retest thoroughly.
- */
- list_for_each_entry(ep, &udc->gadget.ep_list, ep.ep_list) {
- if (ep->desc) {
- spin_unlock(&udc->lock);
- usba_ep_disable(&ep->ep);
- spin_lock(&udc->lock);
- }
- }
}
static struct usba_ep *get_ep_by_addr(struct usba_udc *udc, u16 wIndex)