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

Commit 7fe34d13 authored by Ajay Agarwal's avatar Ajay Agarwal
Browse files

phy: msm: usb: Fix USB suspend issue on cable disconnect



Currently on cable disconnect, we put the runtime PM counter
before marking the otg_state to B_IDLE. This leads to abort of
msm_otg_suspend since otg_state is still B_PERIPHERAL, and USB
does not go into low power mode.
Fix this by first marking otg_state to B_IDLE and then putting
the runtime PM count.

Change-Id: I1501b02ff13a549d8441279d14a7e860478f8a39
Signed-off-by: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent 46211fdd
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2837,11 +2837,11 @@ static void msm_otg_sm_work(struct work_struct *w)
			msm_otg_start_peripheral(otg, 0);
			msm_otg_dbg_log_event(phy, "RT PM: B_PERI A PUT",
				get_pm_runtime_counter(dev), 0);
			/* Schedule work to finish cable disconnect processing*/
			otg->state = OTG_STATE_B_IDLE;
			/* _put for _get done on cable connect in B_IDLE */
			pm_runtime_mark_last_busy(dev);
			pm_runtime_put_autosuspend(dev);
			/* Schedule work to finish cable disconnect processing*/
			otg->state = OTG_STATE_B_IDLE;
			work = 1;
		} else if (test_bit(A_BUS_SUSPEND, &motg->inputs)) {
			pr_debug("a_bus_suspend\n");