Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b3166f85 authored by Pratham Pratap's avatar Pratham Pratap Committed by Gerrit - the friendly Code Review server
Browse files

usb: dwc3: gadget: Clear run/stop irrespective of softconnect



In a scenario, where disconnnect is racing with composition
switch the run/stop bit is not getting cleared from vbus_session
since dwc3_gadget_pullup is waiting for the spinlock to be released.

Fix this by clearing run/stop bit irrespective of softconnect.

Change-Id: Ib2331061043cd20e149d35049587f44769906c89
Signed-off-by: default avatarPratham Pratap <prathampratap@codeaurora.org>
parent b09ff0a7
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -2402,8 +2402,6 @@ static int dwc3_gadget_vbus_session(struct usb_gadget *_gadget, int is_active)
			 * signaled by the gadget driver.
			 */
			ret = dwc3_gadget_run_stop(dwc, 1, false);
		} else {
			ret = dwc3_gadget_run_stop(dwc, 0, false);
		}
	}

@@ -2412,6 +2410,7 @@ static int dwc3_gadget_vbus_session(struct usb_gadget *_gadget, int is_active)
	 * Make sure to let gadget driver know in that case.
	 */
	if (!dwc->vbus_active) {
		ret = dwc3_gadget_run_stop(dwc, 0, false);
		dev_dbg(dwc->dev, "calling disconnect from %s\n", __func__);
		dwc3_gadget_disconnect_interrupt(dwc);
	}