Repository navigation
Conversation
…it at remove Probe registered the SMC notifier and then ran INIT_WORK() on critical_work again. devm_work_autocancel() had already set it up. An SMC critical-battery event that came in between could have its queued work reset under it. dbg_log_work was set up only after the notifier. Remove used cancel_work() and cancel_delayed_work(), which do not wait, and unregistered the notifier last. The debug work re-arms itself, so it could run, or queue itself again, after devm had freed the driver state. Set up both work items before anything can queue them, and drop the second INIT_WORK(). At remove, unregister the notifier and clear g_power first. Then disable_delayed_work_sync() the debug work and cancel_work_sync() the critical work. Two comments say what stays as it is. Probe does not reset the charge inhibitors, as commit b8e84d0 ("power: supply: macsmc: Preserve firmware charge settings at probe") decided. The user's CHLS limit during a CHLS_HOLD is kept in RAM only, so a hold found at probe has no known limit. Probe now logs that case. Verified: read against the workqueue and devm helpers. Not compiled or run here (macOS host). KUnit for this file has no probe or remove case. Signed-off-by: Alyx-ML <256263590+Alyx-ML@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the #2755 split. Draft until it has a run on a Mac (the last Evidence line says which).
Summary
Probe still keeps the firmware charge settings (b8e84d0), and now logs a CHLS_HOLD it finds
with no known limit.
Evidence
could run after devm freed the driver state (found by reading against the workqueue and devm
helpers).
macsmc, which includes the macsmc-power tests):passed, Apple build and KUnit. Those tests have no probe or remove case.
macsmc-power again.
Merge Danger
Door: two-way
Blast Radius: battery reporting
Assisted-by: LLM (Claude:Opus 5.5)