-
Notifications
You must be signed in to change notification settings - Fork 74
qcom_fg: handle SRAM readiness across suspend/resume #231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 6.16.3/main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove [PATCH]
from the commit title and please add Signed-off-by:
git commit -s --amend
If this driver was taken from 8996 kernel, maybe it should be sent to 8996 kernel repo, where we all can then sync it from again..? |
8996 was get it from sdm845 so it should be sent back there maybe. |
there is another fix qcom_fg.PATCH.
|
…mption-proof power: supply: qcom_fg: simplify synchronization for SRAM accesses The fuel gauge SRAM may become ready during the suspend-to-resume transition. In this case, the system can enter standby before SRAM is ready, and the mem-avail interrupt will never fire. As a result, the driver misses the readiness event and its state becomes inconsistent. Introduce single mutex lock to ensure no races occur between release work thread. Additionally ensure that SRAM access is released before system is suspended. Signed-off-by: Tomasz Duda <[email protected]> Signed-off-by: Vladimir Lypak <[email protected]>
The fuel gauge SRAM may become ready during the suspend-to-resume transition. In this case, the system can enter standby before SRAM is ready, and the mem-avail interrupt will never fire. As a result, the driver misses the readiness event and its state becomes inconsistent.
Ensure that the SRAM is ready before suspending to avoid this issue.
A theoretical race condition may still exist, depending on the suspend ordering of related drivers, but this change prevents the common case of missed readiness.