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

Commit 8616e973 authored by Sujeet Kumar's avatar Sujeet Kumar
Browse files

USB: phy-msm-usb: Queue smwork from PM notify in device mode



Fast plug out and plugin of dcp charger in PM suspend
state may lead to a state where phy reset have turned
off clocks and msm_otg_suspend access registers leading
to noc errors.

Like in host bus suspend, smwork to be queued
in device mode as well. This will fix such races
during PM resume, and always serialize the access
of smwork, suspend and resume calls.

CRs-Fixed: 684659
Change-Id: Icf5542f1c685d11d9d21eb374f2a7ea4ab2d345b
Signed-off-by: default avatarSujeet Kumar <ksujeet@codeaurora.org>
parent 5df047d2
Loading
Loading
Loading
Loading
+1 −10
Original line number Diff line number Diff line
@@ -5146,8 +5146,6 @@ static int msm_otg_pm_resume(struct device *dev)
	dev_dbg(dev, "OTG PM resume\n");

	motg->pm_done = 0;
	if (!motg->host_bus_suspend)
		atomic_set(&motg->pm_suspended, 0);

	if (motg->async_int || motg->sm_work_pending ||
			!pm_runtime_suspended(dev)) {
@@ -5159,14 +5157,7 @@ static int msm_otg_pm_resume(struct device *dev)
		pm_runtime_set_active(dev);
		pm_runtime_enable(dev);

		/*
		 * Defer any host mode disconnect events until
		 * all devices are RESUMED
		 */
		if (motg->sm_work_pending && !motg->host_bus_suspend) {
			motg->sm_work_pending = false;
			queue_work(system_nrt_wq, &motg->sm_work);
		}
		/* sm work will start in pm notify */
	}

	return ret;