mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-06 11:54:14 -04:00
usb: dwc3: Dont release wakeup source during usb restart
When changing USB speed via sysfs, the device might utilize the idle time between DISCONNECT and CONNECT events and enter suspend. As a result the pending CONNECT might get delayed thus pushing USB enumeration during the next resume. Avoid this by not releasing the wakeup source when usb restart is in progress. Change-Id: I754b76eb7b36923a2dcd4d58587101750d1cd83c Signed-off-by: Elson Roy Serrao <eserrao@codeaurora.org>
This commit is contained in:
parent
c4e2bcf66f
commit
980a25b5c2
1 changed files with 13 additions and 11 deletions
|
|
@ -3374,17 +3374,19 @@ static int dwc3_msm_suspend(struct dwc3_msm *mdwc, bool force_power_collapse,
|
|||
|
||||
dwc3_msm_update_bus_bw(mdwc, BUS_VOTE_NONE);
|
||||
|
||||
/*
|
||||
* release wakeup source with timeout to defer system suspend to
|
||||
* handle case where on USB cable disconnect, SUSPEND and DISCONNECT
|
||||
* event is received.
|
||||
*/
|
||||
if (mdwc->lpm_to_suspend_delay) {
|
||||
dev_dbg(mdwc->dev, "defer suspend with %d(msecs)\n",
|
||||
mdwc->lpm_to_suspend_delay);
|
||||
pm_wakeup_event(mdwc->dev, mdwc->lpm_to_suspend_delay);
|
||||
} else {
|
||||
pm_relax(mdwc->dev);
|
||||
if (!mdwc->in_restart) {
|
||||
/*
|
||||
* release wakeup source with timeout to defer system suspend to
|
||||
* handle case where on USB cable disconnect, SUSPEND and DISCONNECT
|
||||
* event is received.
|
||||
*/
|
||||
if (mdwc->lpm_to_suspend_delay) {
|
||||
dev_dbg(mdwc->dev, "defer suspend with %d(msecs)\n",
|
||||
mdwc->lpm_to_suspend_delay);
|
||||
pm_wakeup_event(mdwc->dev, mdwc->lpm_to_suspend_delay);
|
||||
} else {
|
||||
pm_relax(mdwc->dev);
|
||||
}
|
||||
}
|
||||
|
||||
atomic_set(&dwc->in_lpm, 1);
|
||||
|
|
|
|||
Loading…
Reference in a new issue