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

Skip to content
Commit 6eae5c28 authored by Saket Saurabh's avatar Saket Saurabh
Browse files

usb: phy-msm-usb.c: Fix timeout during usb disconnect with hvdcp charger



Once DCP is detected, ext_chg_active is set to true and DCP uevent
reached to user space. The hvdcp main thread mark dcp_connected to
true and wakesup the detector thread to do hvdcp detection. But before
the detector thread gets a chance to run, DCP is removed. The disconnect
uevent reached the user space and the hvdcp main thread marks the
dcp_connected to false and it will not call any ioctl call. As
ext_chg_active is still set to true, it is waiting for 3 seconds while
processing usb disconnect.

Also it is possible that DCP uevent is reached to the user space much
before ext_chg_active flag is set to true in otg state machine work which
later leads to timeout of 3 seconds later while processing usb disconnect.

Fix these issues by maintaining different states for ext_chg_active. Upon
DCP disconnect, if the ext_chg_active value is still default, mark it to
inactive. This avoid the 3 seconds wait timeout while processing the usb
disconnect.

CRs-Fixed: 671181
Change-Id: Ic4aa6745e994a007bd6bd2e75d4f44fb8f7ac9c1
Signed-off-by: default avatarSaket Saurabh <ssaurabh@codeaurora.org>
parent 394c9c0d
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