mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 05:39:54 -04:00
usb: dwc3: ep0: Fail enqueue() when racing with vbus_sess disconnect
When the setup packet comes right before the disconnect notification there is a possible race between clearing the run stop bit and enqueuing the setup packet. This results in controller halt failure. Add a vbus_active check before enqueuing the packet to fix this issue. Change-Id: I3921a1fa92a0f5c6892f1cc3ffe9dda6366b72b1 Signed-off-by: Elson Roy Serrao <eserrao@codeaurora.org> Signed-off-by: Jack Pham <jackp@codeaurora.org>
This commit is contained in:
parent
6e65b88e7d
commit
904ab34b54
1 changed files with 2 additions and 1 deletions
|
|
@ -197,7 +197,8 @@ 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 || !dwc->pullups_connected) {
|
||||
if (!dep->endpoint.desc || !dwc->softconnect ||
|
||||
!dwc->vbus_active) {
|
||||
dev_err(dwc->dev, "%s: can't queue to disabled endpoint\n",
|
||||
dep->name);
|
||||
ret = -ESHUTDOWN;
|
||||
|
|
|
|||
Loading…
Reference in a new issue