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

Commit ad88a05b authored by Xiaozhe Shi's avatar Xiaozhe Shi Committed by Abhijeet Dharmapurikar
Browse files

power: qpnp-smbcharger: fix race condition in APSD rerun



Currently there is a race condition in the rerun_aspd_work routine. The
driver only checks whether the USBIN_UV status is high after forcing
USBIN undervoltage before allowing the source detect interrupt to change
the USB status. If the falling edge of the SRC_DET interrupt induced
by the APSD rerun algorithm is handled after the rerun algorithm clears
the flag to ignore USBIN_UV and SRC_DET interrupts, it can cause
problems by invoking the USB removal code path. This ends up allowing the
subsequent rising edge of the source interrupt to trigger yet another
APSD rerun, creating an infinite loop of APSD reruns.

Fix this by waiting for the falling edge of the source detect interrupt
during the APSD rerun algorithm before allowing the USB to be detected
the second time.

CRs-Fixed: 823770
Change-Id: I434113c9475368bc543d396be016cc641e9ee540
Signed-off-by: default avatarXiaozhe Shi <xiaozhes@codeaurora.org>
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent 24d8f022
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