USB: Clear pm_done flag to false in msm_otg_sm_work
As part of USB disconnect event, msm_otg_suspend() executes and USB
enters into low power mode and pm_done flag is set to true. In the
scenario in which before the msm_otg_suspend() finished executing,
then USB connect event came in, in this case msm_otg_suspend() returns
-EBUSY. And later USB connect event is processed. As device is already
in resumed state, hence pm_done flag is never set to false. So on
next USB connect pm usage counter gets incremented in msm_otg_sm_work()
and device cannot enter into sleep state.
Fix the issue by clearing pm_done flag to false as part of usb connect
in msm_otg_sm_work().
CRs-fixed: 649434
Change-Id: Ibc36221b2f8b781322fa741b1b6639dd813c0810
Signed-off-by: Saket Saurabh <ssaurabh@codeaurora.org>
2 files changed