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:Xiaozhe Shi <xiaozhes@codeaurora.org> Signed-off-by:
Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Loading
Please register or sign in to comment