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

Skip to content
Commit cbf21b24 authored by ChandanaKishori Chiluveru's avatar ChandanaKishori Chiluveru Committed by Gerrit - the friendly Code Review server
Browse files

usb: phy-msm-usb: Add new B_CHARGER state to improve runtime PM handling



OTG state machine work missing to handle events in fast PIPO or a
rogue charger toggling VBUS very frequently and this results in extra
runtime_put in B_IDLE state on BSV SET -> BSV SET.

When device is entering system suspend and USB DCP charger is
disconnected, then due to VBUS clear from PMIC, the device will
be PM resumed and schedule the sm work for BSV clear. Now shortly
just before running the disconnect work, BSV set event came and it
will handle VBUS set condition in sm work and hence it did not take
count, because dpm_prepare took count already. dpm_complete did not
finish by this time where it drops the matching count which was taken
by dpm_prepare. After DCP charger detection, dropped count hence pm
count is 0. This should happen after dpm_prepare and before pm_suspend.

Now the counter became negative. Because of this counter mismatch,
SM work will not increment the count before processing the BSV set
or clear events. Because of this runtime idle may put USB in LPM
and a disconnect processing may still be running after USB entered
into low power mode leading to unclocked access in charger block off.

OTG_STATE_B_CHARGER state is used to handle connect and disconnects
with DCP/PROP charger. If a charger connected followed by cable disconnect
and before running the disconnect work BSV set event came. Controller
driver relies on OTG state OTG_STATE_B_CHARGER to check for VBUS session
valid for the disconnect case and change OTG state to OTG_STATE_B_IDLE
to handle cancel the changer work.

CRs-Fixed: 819308
Change-Id: I17b3b327cc5bd48d24e914e3497976ebb541e066
Signed-off-by: default avatarChandanaKishori Chiluveru <cchilu@codeaurora.org>
parent 937c12df
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