]> git.baikalelectronics.ru Git - kernel.git/commit
usb: dwc3: Stop active transfers before halting the controller
authorWesley Cheng <wcheng@codeaurora.org>
Thu, 12 Aug 2021 17:16:46 +0000 (20:16 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 15 Aug 2021 11:08:03 +0000 (13:08 +0200)
commit26593020e668f7c4dd9fe6a527a4221d2c0721f8
treef5602fe996cf89a526c95f50cc37d01cc271e853
parent1b881d7aef94fcfa3b16aa05aceb7d9e65021f3c
usb: dwc3: Stop active transfers before halting the controller

[ Upstream commit ae7e86108b12351028fa7e8796a59f9b2d9e1774 ]

In the DWC3 databook, for a device initiated disconnect or bus reset, the
driver is required to send dependxfer commands for any pending transfers.
In addition, before the controller can move to the halted state, the SW
needs to acknowledge any pending events.  If the controller is not halted
properly, there is a chance the controller will continue accessing stale or
freed TRBs and buffers.

Signed-off-by: Wesley Cheng <wcheng@codeaurora.org>
Reviewed-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/ep0.c
drivers/usb/dwc3/gadget.c