Skip to content

Commit 12b94da

Browse files
cristibirsanfelipebalbi
authored andcommitted
usb: gadget: udc: atmel: Fix vbus disconnect handling
A DMA transfer can be in progress while vbus is lost due to a cable disconnect. For endpoints that use DMA, this condition can lead to peripheral hang. The patch ensures that endpoints are disabled before the clocks are stopped to prevent this issue. Fixes: a64ef71 ("usb: gadget: atmel_usba_udc: condition clocks to vbus state") Signed-off-by: Cristian Birsan <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
1 parent 49e0590 commit 12b94da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/usb/gadget/udc/atmel_usba_udc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1951,10 +1951,10 @@ static irqreturn_t usba_vbus_irq_thread(int irq, void *devid)
19511951
usba_start(udc);
19521952
} else {
19531953
udc->suspended = false;
1954-
usba_stop(udc);
1955-
19561954
if (udc->driver->disconnect)
19571955
udc->driver->disconnect(&udc->gadget);
1956+
1957+
usba_stop(udc);
19581958
}
19591959
udc->vbus_prev = vbus;
19601960
}

0 commit comments

Comments
 (0)