diff options
author | Mayank Rana <mrana@codeaurora.org> | 2017-11-03 10:40:10 -0700 |
---|---|---|
committer | Ajay Agarwal <ajaya@codeaurora.org> | 2019-09-18 16:10:24 +0530 |
commit | 358afa57426ff712993e186fc40583f7ae6dcd49 (patch) | |
tree | 6f04cf350197b092a62276eba51486b13ed2095f /drivers/usb/dwc3/dwc3-msm.c | |
parent | 6e94fb15c868d3599ea8cad7f0aa81786b79baaf (diff) |
dwc3-msm: Replace autosuspend delay functionality with stop host mode
With ID clear notification i.e. USB host mode disconnect, current
code is using PM runtime autosuspend functionality to put USB into
LPM having autosuspend delay of 1sec. With USB host mode cable
disconnect/connect having delay of less than 1 second, USB doesn't
go into LPM in between USB host mode disconnect and USB host mode
cable connect. This results into XHCI controller not being reset as
expected causing USB low speed and high speed device enumeration
issue with connect-debounce failure condition. Fix this issue by
replacing autosuspend functionality by pm_runtime_put_sync_suspend()
to put USB into LPM with USB host cable disconnect immediately.
While at it, also move queueing of sm_work function to dedicated
sm_usb_wq from system workqueue to avoid parallel runs.
Change-Id: I0db6ea7e63b853e419ccfd51808b8955e874db76
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
Diffstat (limited to 'drivers/usb/dwc3/dwc3-msm.c')
-rw-r--r-- | drivers/usb/dwc3/dwc3-msm.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/usb/dwc3/dwc3-msm.c b/drivers/usb/dwc3/dwc3-msm.c index 0650f0b69de7..5008dd08d4c9 100644 --- a/drivers/usb/dwc3/dwc3-msm.c +++ b/drivers/usb/dwc3/dwc3-msm.c @@ -2229,7 +2229,7 @@ static int dwc3_msm_suspend(struct dwc3_msm *mdwc, bool hibernation) /* kick_sm if it is waiting for lpm sequence to finish */ if (test_and_clear_bit(WAIT_FOR_LPM, &mdwc->inputs)) - schedule_delayed_work(&mdwc->sm_work, 0); + queue_delayed_work(mdwc->sm_usb_wq, &mdwc->sm_work, 0); mutex_unlock(&mdwc->suspend_resume_mutex); @@ -3748,8 +3748,7 @@ static int dwc3_otg_start_host(struct dwc3_msm *mdwc, int on) /* wait for LPM, to ensure h/w is reset after stop_host */ set_bit(WAIT_FOR_LPM, &mdwc->inputs); - pm_runtime_mark_last_busy(mdwc->dev); - pm_runtime_put_sync_autosuspend(mdwc->dev); + pm_runtime_put_sync_suspend(mdwc->dev); dbg_event(0xFF, "StopHost psync", atomic_read(&mdwc->dev->power.usage_count)); } |