usb: dwc3-msm: Fix system suspend race with USB connection
DWC3 driver releases/acquires wake_lock as part of its
runtime suspend/resume routines. This allows DWC3's system
suspend routine to be called only after its wake_lock has been
released as part of runtime suspend. But, currently there exists
a race in code where DWC3 may receive a wakeup event just before
its system suspend is kicked-in. Though USB is brought out of LPM
as part of wakeup event processing but it may be put in LPM again
by DWC3's system suspend, resulting in missed USB wakeup event.
Fix this by aborting system suspend if USB is not in LPM. And also
flush resume_work from system suspend to make sure any pending
wakeup event has already been processed before the safeguard check.
Change-Id: Ida57c7aca17065c671b446fc8a66b83d3a356f36
CRs-Fixed: 441974
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
1 file changed