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

Commit 5f65d754 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 058415b5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2935,10 +2935,10 @@ static void msm_otg_sm_work(struct work_struct *w)
			msm_otg_start_peripheral(otg, 0);
			msm_otg_dbg_log_event(&motg->phy, "RT PM: B_PERI A PUT",
				get_pm_runtime_counter(dev), 0);
			/* _put for _get done on cable connect in B_IDLE */
			pm_runtime_put_noidle(dev);
			/* Schedule work to finish cable disconnect processing*/
			otg->phy->state = OTG_STATE_B_IDLE;
			/* _put for _get done on cable connect in B_IDLE */
			pm_runtime_put_noidle(dev);
			work = 1;
		} else if (test_bit(A_BUS_SUSPEND, &motg->inputs)) {
			pr_debug("a_bus_suspend\n");