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: Elson Roy Serrao <eserrao@codeaurora.org>
This commit is contained in:
Elson Roy Serrao 2019-11-22 10:36:37 -08:00 • committed by Gerrit - the friendly Code Review server
commit 39cb120666

View file

@ -4920,8 +4920,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.
@ -4965,8 +4963,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) {