From 39cb1206667ae845236040d169abc2d8d4c95650 Mon Sep 17 00:00:00 2001 From: Elson Roy Serrao Date: Fri, 22 Nov 2019 10:36:37 -0800 Subject: [PATCH] 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 --- drivers/usb/dwc3/dwc3-msm.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-msm.c b/drivers/usb/dwc3/dwc3-msm.c index 48249d1f0c0d..620f0919e81b 100644 --- a/drivers/usb/dwc3/dwc3-msm.c +++ b/drivers/usb/dwc3/dwc3-msm.c @@ -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) {