mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-06 03:45:24 -04:00
usb: dwc: Release wakeup source if vbus_active is cleared
Commit 980a25b5c2 ("usb: dwc3: Dont release wakeup source
during usb restart") introduced a check in dwc3_msm_suspend
for in_restart before releasing the wakeup source to ensure
that driver doesn't release the wakeup source if suspend is
kicked while restart session was executing. Now consider a
case where, due to some reason, erratic event is seen on the
controller and restart session is kicked. While restart work
was running, physical cable disconnect happened which will
call suspend routine eventually but due to in_restart flag
being set driver will not release the wakeup source and will
end up consuming power even though cable got disconnected.
Fix this by adding one more level of judgement of vbus_active
to ensure that wakeup source is released when cable gets
disconnected during restart usb work.
Change-Id: Ie54618640d08c4f2e3f0dc1d38260e0aa2d309c2
Signed-off-by: Pratham Pratap <quic_ppratap@quicinc.com>
This commit is contained in:
parent
b02a89590b
commit
f5f85bb96c
1 changed files with 10 additions and 0 deletions
|
|
@ -2324,6 +2324,10 @@ static void dwc3_restart_usb_work(struct work_struct *w)
|
|||
|
||||
dwc->err_evt_seen = false;
|
||||
flush_delayed_work(&mdwc->sm_work);
|
||||
|
||||
/* see comments in dwc3_msm_suspend */
|
||||
if (!mdwc->vbus_active)
|
||||
pm_relax(mdwc->dev);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -3375,6 +3379,12 @@ static int dwc3_msm_suspend(struct dwc3_msm *mdwc, bool force_power_collapse,
|
|||
|
||||
dwc3_msm_update_bus_bw(mdwc, BUS_VOTE_NONE);
|
||||
|
||||
/*
|
||||
* If in_restart is marked as true from restart work do not release the wakeup
|
||||
* active source as it can lead the device to enter system suspend (if usb is
|
||||
* the last holding the wakeup active source). If actual cable disconnect happens
|
||||
* while in_restart is true wakeup active source will be released from restart work.
|
||||
*/
|
||||
if (!mdwc->in_restart) {
|
||||
/*
|
||||
* release wakeup source with timeout to defer system suspend to
|
||||
|
|
|
|||
Loading…
Reference in a new issue