diff options
author | Wesley Cheng <wcheng@codeaurora.org> | 2020-09-29 02:20:59 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@kernel.org> | 2020-10-02 08:57:46 +0200 |
commit | ae7e86108b12351028fa7e8796a59f9b2d9e1774 (patch) | |
tree | 539ddd97b6ac54a7da80d492b2735f8faba88f2a /drivers/usb/dwc3/ep0.c | |
parent | usb: cdns3: gadget: enlarge the TRB ring length (diff) | |
download | linux-ae7e86108b12351028fa7e8796a59f9b2d9e1774.tar.xz linux-ae7e86108b12351028fa7e8796a59f9b2d9e1774.zip |
usb: dwc3: Stop active transfers before halting the controller
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>
Diffstat (limited to 'drivers/usb/dwc3/ep0.c')
-rw-r--r-- | drivers/usb/dwc3/ep0.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index 5580caed8b0c..7be3903cb842 100644 --- a/drivers/usb/dwc3/ep0.c +++ b/drivers/usb/dwc3/ep0.c @@ -197,7 +197,7 @@ int dwc3_gadget_ep0_queue(struct usb_ep *ep, struct usb_request *request, int ret; spin_lock_irqsave(&dwc->lock, flags); - if (!dep->endpoint.desc) { + if (!dep->endpoint.desc || !dwc->pullups_connected) { dev_err(dwc->dev, "%s: can't queue to disabled endpoint\n", dep->name); ret = -ESHUTDOWN; |