USB: phy-msm-usb: Avoid race b/w sm_work and set_suspend
OTG's set_suspend routine is used by host controller (EHCI)
driver to suspend or resume USB OTG/PHY hardware from its
runtime suspend/resume callbacks. OTG set_suspend routine
uses sm_workqueue to put hardware in LPM (or suspend it).
As there is no synchronization between sm_work and
set_suspend, this results in both racing with each other.
Sometimes with fast back to back set_suspend calls, PHY LPM
state goes out of sync than what requested by host driver.
Fix this by flushing work from set_suspend to complete
event processing by sm_work.
CRs-fixed: 654489
Change-Id: I5e0bfa3bc6c12af23fd26b2496c7ee5b7fc1488e
Signed-off-by:
Manu Gautam <mgautam@codeaurora.org>
Loading
Please register or sign in to comment