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

Commit bf85596d authored by Manu Gautam's avatar Manu Gautam Committed by Gerrit - the friendly Code Review server
Browse files

USB: dwc3: Check for U0 before detecting missed bus-wakeup



Some of the endpoint events could be processed after U3
entry. Hence, explicitly check for U0 state before
initiating gadget wakeup on endpoint events processing.

Change-Id: I1bc295adc971f6a0e4d2409de8455511a6bb8970
Signed-off-by: default avatarManu Gautam <mgautam@codeaurora.org>
parent 4ef2d895
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3497,7 +3497,8 @@ static void dwc3_process_event_entry(struct dwc3 *dwc,
		 * wouldn't give wakeup event after resume. Handle that
		 * here on ep event which indicates that bus is resumed.
		 */
		if (dwc->b_suspend)
		if (dwc->b_suspend &&
		    dwc3_get_link_state(dwc) == DWC3_LINK_STATE_U0)
			dwc3_gadget_wakeup_interrupt(dwc, false);
		return dwc3_endpoint_interrupt(dwc, &event->depevt);
	}