]> 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)
commitc9a575d9d2d4ef216c2e3896f6684cbe54521e3f
treef5602fe996cf89a526c95f50cc37d01cc271e853
parent71140b72da4e9d19d984d3f671bdf6080a8a4a53
usb: dwc3: Stop active transfers before halting the controller

[ Upstream commit d1ed52393959dae8fdda7ea3210b040984ef90c1 ]

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