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

Commit 8a0eb1b7 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: dwc3: gadget: Release gadget lock when handling suspend/resume"

parents 21bcd95b 1a5456df
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -2739,7 +2739,13 @@ static void dwc3_gadget_wakeup_interrupt(struct dwc3 *dwc)
	 */

	dbg_event(0xFF, "WAKEUP", 0);
	/*
	 * gadget_driver resume function might require some dwc3-gadget
	 * operations, such as ep_enable. Hence, dwc->lock must be released.
	 */
	spin_unlock(&dwc->lock);
	dwc->gadget_driver->resume(&dwc->gadget);
	spin_lock(&dwc->lock);
}

static void dwc3_gadget_linksts_change_interrupt(struct dwc3 *dwc,
@@ -2833,7 +2839,14 @@ static void dwc3_gadget_suspend_interrupt(struct dwc3 *dwc,

	if (next == DWC3_LINK_STATE_U3) {
		dbg_event(0xFF, "SUSPEND", 0);
		/*
		 * gadget_driver suspend function might require some dwc3-gadget
		 * operations, such as ep_disable. Hence, dwc->lock must be
		 * released.
		 */
		spin_unlock(&dwc->lock);
		dwc->gadget_driver->suspend(&dwc->gadget);
		spin_lock(&dwc->lock);
	}

	dwc->link_state = next;