usb: gadget: udc: atmel: Fix vbus disconnect handling
authorCristian Birsan <cristian.birsan@microchip.com>
Fri, 10 Apr 2020 12:14:52 +0000 (15:14 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 2 May 2020 06:48:43 +0000 (08:48 +0200)
commit9dcb1844f884e8294e46ff317b0532068784eb5f
tree04a7909702238dbba3e14a83e85ff24bcb83f4e2
parent7155416143dd92957505f355bf117b2708af6221
usb: gadget: udc: atmel: Fix vbus disconnect handling

commit 12b94da411f9c6d950beb067d913024fd5617a61 upstream.

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: a64ef71ddc13 ("usb: gadget: atmel_usba_udc: condition clocks to vbus state")
Signed-off-by: Cristian Birsan <cristian.birsan@microchip.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/udc/atmel_usba_udc.c