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

Commit b6862cee authored by Manu Gautam's avatar Manu Gautam
Browse files

USB: dwc3: Handle host resume after failed remote wakeup-up



If remote-wakeup attempt by device had failed, then core
wouldn't give wakeup event after host resumes bus later.
Handle that by resuming gadget on receiving EP event which
indicates that bus has indeed resumed.

Change-Id: Idab5dc11e04116abf9a79fcef68fd38ede07b24a
Signed-off-by: default avatarManu Gautam <mgautam@codeaurora.org>
parent 77dd6ca0
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -3632,6 +3632,13 @@ static void dwc3_process_event_entry(struct dwc3 *dwc,
	/* Endpoint IRQ, handle it and return early */
	if (event->type.is_devspec == 0) {
		/* depevt */
		/* If remote-wakeup attempt by device had failed, then core
		 * wouldn't give wakeup event after resume. Handle that
		 * here on ep event which indicates that bus is resumed.
		 */
		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);
	}