aboutsummaryrefslogtreecommitdiff
path: root/scripts/gcc-wrapper.py
diff options
context:
space:
mode:
authorSaket Saurabh <ssaurabh@codeaurora.org>2014-01-15 11:49:30 +0530
committerSaket Saurabh <ssaurabh@codeaurora.org>2014-01-16 16:41:33 +0530
commit1bc40bca4986ba7b14b4b495f3d1f2a9b95a4ae0 (patch)
tree4a85fe8ef604d70f98d08337c50587499513c6d1 /scripts/gcc-wrapper.py
parent02983880ebd8c4c35de72f97d225e6d8232c76cd (diff)
USB: msm_otg: Fix race between PM resume and charger detection
When device is in system suspend and USB charger is disconnected, then due to VBUS clear IRQ from PMIC, the device will be PM resumed. Now shortly if PMIC driver detects valid VBUS it will handle VBUS set condition,notifies to msm_otg and msm_otg will kick in charger detection mechanism. During PM resume, in dmp_complete() it will call a pm_runtime_put_sync(), which will immediately kick off the PM runtime idle and suspend routines. dpm_complete() ->device_complete() ->pm_runtime_put_sync() ->rpm_idle() ->rpm_suspend() The PM resume also runs in a separate worker queue, so it is not guaranteed that it will finish executing before we finish the charger detection stage. During this case there is a race if dpm_complete() returns before charger detection starts. Return of dmp_cpmplete() before charger detection will make USB to enter LPM. As USB will be in LPM now and if charger detection starts then it will lead to unclocked access. Fixing the issue by handling the pm usage count using the variable pm_done in msm_otg. When USB charger is disconnected and msm_otg processes the disconnect event it marks the pm_done to true. Later when USB charger is connected , mark the pm_done to false in msm_otg_runtime_resume(). If pm_done is true increment the pm counter using pm_runtime_get_sync. This handles the race case when PM resume thread returns before the charger detection starts. CRs-Fixed: 599143 Change-Id: I6de19fe850e24efa03ea71c7d14e388c15cf2f97 Signed-off-by: Saket Saurabh <ssaurabh@codeaurora.org>
Diffstat (limited to 'scripts/gcc-wrapper.py')
0 files changed, 0 insertions, 0 deletions