Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 7d8c659c authored by Ido Shayevitz's avatar Ido Shayevitz
Browse files

usb: dwc3-msm: Fix LPM race condition on cable disconnect



In some cases, the pm_runtime_suspend may be called by the usb_bam.c
when there is pending lpm flag set after waiting IPA resource manager
to release the consumer resource. However, if this is done when the
usb cable was disconnected and otg state has not yet changed to IDLE,
it can lead to a crash due to access to a core register while in LPM.

The reason is that when usb cable was disconnected and otg state
has not yet changed to IDLE, it means that the otg state machine
is still running or about to run and we race against it. When the
otg state machine will complete the transition to IDLE state, it
will invoke the LPM separately. The specific crash was in the
function msm_ssusb_qmp_enable_autonomous(), which is invoked
up the SW sequence by the otg state machine function which does
start_peripheral(0).

Therefore, if we catch such a case, fix it by cancel the LPM for now,
and the otg state machine will go to LPM later.

CRs-Fixed: 687668
Change-Id: Iaf2d8bd3156245c83a1b9bab4b9d62c82f16a7c2
Signed-off-by: default avatarIdo Shayevitz <idos@codeaurora.org>
parent 110f3df6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment