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

Commit 880cdfd2 authored by Elson Roy Serrao's avatar Elson Roy Serrao
Browse files

usb: dwc3: Avoid resume_work flush in pm_suspend/pm_resume



dwc3_resume_work is dependent on sm_work which is a freezable task.
When control reaches pm_suspend or pm_resume sm_work is frozen at
that point as part of freeze_processes() api which is called for
system-wide suspend. If there is any pending work on sm_work and we
try to flush when it is frozen we end up in a deadlock as the
suspend/resume thread cannot progress. Avoid flushing this wq in
pm_suspend/resume.

Change-Id: I5eada1c3d11085fcd1b424a1bdb7e0c949f7ef42
Signed-off-by: default avatarElson Roy Serrao <eserrao@codeaurora.org>
parent d66d368d
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -4626,8 +4626,6 @@ static int dwc3_msm_pm_suspend(struct device *dev)
	dev_dbg(dev, "dwc3-msm PM suspend\n");
	dbg_event(0xFF, "PM Sus", 0);

	flush_workqueue(mdwc->dwc3_wq);

	/*
	 * Check if pm_suspend can proceed irrespective of runtimePM state of
	 * host.
@@ -4671,8 +4669,6 @@ static int dwc3_msm_pm_resume(struct device *dev)
	dev_dbg(dev, "dwc3-msm PM resume\n");
	dbg_event(0xFF, "PM Res", 0);

	/* flush to avoid race in read/write of pm_suspended */
	flush_workqueue(mdwc->dwc3_wq);
	atomic_set(&mdwc->pm_suspended, 0);

	if (!dwc->host_poweroff_in_pm_suspend || !mdwc->in_host_mode) {