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

Skip to content
Commit 81ca96c8 authored by Saket Saurabh's avatar Saket Saurabh
Browse files

phy_msm_usb: Fix crash when switching from peripheral to host mode



When system boots up, USB driver waits using wait_for_completion()
event for the initial VBUS state notification from PMIC.
Once VBUS initial state is reported to USB after PMIC driver
initialization, USB sets the completion variable pmic_vbus_done
to value 1. Later wait_for_completion() event sets the variable
pmic_vbus_done to value 0.

For USB cable disconnect/connect events, PMIC notifies to USB
through msm_otg_set_vbus_state() and USB queues msm_otg_sm_work()
to process the disconnect/connect events. For the crash scenario,
as the variable pmic_vbus_done value is set to zero, hence USB
returns from msm_otg_set_vbus_state() without queuing the
msm_otg_sm_work() due to which USB disconnect event is not processed
and crash happens when USB switching from peripheral to host mode.

Fixing the issue using a static flag init which will be initialized
to false. Once VBUS initial state is reported to USB after PMIC
driver initialization, set the static flag init to true.

CRs-Fixed: 607067
Change-Id: Id229537f9223a031f68b793725021225e13376a7
Signed-off-by: default avatarSaket Saurabh <ssaurabh@codeaurora.org>
parent ddc46d3a
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