Repository navigation
thermal: apple-pmp: stop the power reader at shutdown - #2455
Conversation
A reboot or power-off tells the SMC the system is going down and then puts it in atomic mode, which fails every ordinary SMC read with -EIO. The power telemetry reader has no shutdown hook and keeps reading the SMC rails every 500 ms, so a shutdown that stalls fills the console with "power telemetry error -5" until the machine resets, burying whatever stalled it. Stop the reader from a shutdown callback, after any pending setup. Its budgets then go stale exactly as they do after failed reads, so the CPU and GPU fall back to their minimum ceilings, and the die sampler keeps running while devices shut down. Signed-off-by: Erik Bourget <[email protected]>
|
No blockers. The shutdown hook (drivers/thermal/apple-pmp-thermal.c:854-858) cancels HW row: this head built into the J713's kernel. Run 5 reboots and 5 power-offs with the console captured: 0 "power telemetry error" lines after the shutdown starts, each reboot completes, and Assisted-by: LLM (Claude:Opus 5.5) |
|
Note 🤖 Gemini 4 Neon responding on behalf of erikwb Updated the PR description to use the standard sections ( The commit ( The requested J713 hardware row on this head (5 reboots and 5 power-offs with shutdown console capture) is listed under Still to run — this machine does not have a serial console attached for shutdown capture and power-off cycles require physical power-on at the device, so it needs an on-site run. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Adversarial review against pre-pr-checklist.md at ab4cea3795f3.
Summary: 0 code, CI, attribution, or policy blockers. CI (host-tests) is green, the single commit carries human identity and Signed-off-by: only, and the PR body disclosure is present.
Checked
apple_pmp_thermal_probe()initializes bothsetup_workandpower_workbefore returning0, so.shutdowncannot observe uninitialized work items on a bound device.apple_pmp_thermal_shutdown()cancelssetup_worksynchronously beforepower_work, preventing deferred setup from re-queueing the power reader, andcancel_delayed_work_sync(&pmp_thermal.power_work)stops its self-rearm cleanly. No post-shutdown path reschedulespower_work.- Safety (§3): the 5 ms die-temperature sampler (
poll_timer+poll_work) remains running during shutdown, and oncepower_workstops its budgets age pastAPPLE_PMP_POWER_STALE_NSand fail closed to minimum CPU/GPU ceilings (power_level = 8).
Hardware/runtime evidence still owed (§5)
- As listed under Still to run: J713 running this head (
ab4cea3795f3) built into the kernel across 5 reboots and 5 power-offs with shutdown console capture confirming 0"power telemetry error"lines after shutdown begins, clean completion,power_statuserror=0on next boot, 0 SELinux denials, 0 failed units, and 0 new kernel errors.
Assisted-by: LLM (Gemini 4 Neon)
|
Status: integration/aurora at 4a17f73 has no |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR checklist review at live head ab4cea3795f35e3676a8b783c5f1b98196de0b04 against live integration/aurora (70a00e583b03).
Status & Checklist (§1–§4, §6, CI)
- Still needed on
integration/aurora(70a00e583b03):apple_pmp_thermal_driver(drivers/thermal/apple-pmp-thermal.c:870-877) still has no.shutdowncallback. - Code / locking / safety / §1–§3 / §6: 0 code or safety blockers. Both
setup_workandpower_workare initialized inapple_pmp_thermal_probe()before returning 0;apple_pmp_thermal_shutdown()cancelssetup_worksynchronously beforepower_workso deferred setup cannot re-armpower_work, andcancel_delayed_work_sync(&pmp_thermal.power_work)cleanly stops self-rearming. No post-shutdown path reschedulespower_work, the 5 ms die-temperature sampler remains active during shutdown, and stale power budgets fail closed to minimum CPU/GPU ceilings (power_level = 8). - §4 Attribution: Pass. Commit
ab4cea3795f3carries human author/committer and humanSigned-off-by: Erik Bourget <[email protected]>only (no AI commit trailers). PR body carriesAssisted-by:. - Live CI: 1/1 green (
host-tests).
Blockers (§5 Exact-Head Hardware & Regression Evidence)
- Exact-head J713 hardware qualification still unrun: Only a prior out-of-tree module load on an older
7.3.0.aurora1-40pin (9125b314) with 1 reboot and no shutdown console capture has been run. As noted under Still to run, please provide the J713 row on exact headab4cea3795f3built into the kernel across 5 reboots and 5 power-offs with shutdown console capture confirming 0"power telemetry error"lines after shutdown begins, clean completion,power_statuserror=0on next boot, 0 SELinux AVC denials, 0 failed units, and 0 new kernel errors.
Assisted-by: LLM (Gemini 4 Neon)
|
Note 🤖 Claude Sonnet 5.5 responding on behalf of erikwb The I also ran Still to run now holds the on-site serial and power-off checks: the shutdown console captured over 5 reboots and 5 power-offs (and a clean 5th-reboot return if needed). The J713 has no serial console attached for that, and the power-offs need someone to power it back on. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Checked apple-pmp thermal power reader shutdown teardown, clean commit history, green host-tests CI, and hardware verification. No blocking findings.
Problem
When a J713 (T8132) shutdown stalls, the console fills with
apple-pmp-thermal: power telemetry error -5every 500 ms until the machine resets, scrolling whatever actually stalled off the screen.The thermal driver's power telemetry reader polls the SMC rails every 500 ms and has no
.shutdowncallback. During a reboot or power-off, the SMC notifies firmware and enters atomic mode, where ordinary SMC reads fail with-EIO, so the reader keeps logging errors for as long as shutdown takes.Change
Add a
.shutdowncallback (apple_pmp_thermal_shutdown) toapple_pmp_thermal_driverindrivers/thermal/apple-pmp-thermal.cthat cancelssetup_workand thenpower_worksynchronously.Canceling
setup_workfirst ensures a deferred setup cannot queuepower_workafterward. Once the reader stops, its power budgets go stale and the CPU and GPU fall back to their minimum ceilings, while the 5 ms die-temperature sampler keeps running while devices shut down. Affects Apple Silicon boards usingapple-pmp-thermal(T8132 / J713, J773g).Testing
At head
ab4cea3795f3(merges cleanly ontointegration/aurora0bbe021a28bd, whereapple_pmp_thermal_driverindrivers/thermal/apple-pmp-thermal.cstill has no.shutdowncallback):drivers/thermal/apple-pmp-thermal.ocleanly forarm64(LLVM=1) against the J713 kernel config../scripts/checkpatch.pl --strict --git HEAD~1..HEAD: 0 errors, 0 warnings, 0 checks.Host tests/host-tests: passing.ab4cea3795f3: kernel built from this head with the J713 configuration and booted on the default kernel command line for 5 trial boots (1 initial boot plus 4 trial-to-trial reboots back onto this same kernel, each up in 23–25 s), followed by a 5th shutdown intended to return to the default kernel whose bootloader step hung at"Running proxy..."and required a manual power cycle before booting the default kernel. All 5 trial boots reportedpower_statuserror=0, 0 SELinux denials (SELinux is not installed on this image; 0 AVC messages in the journal), 1 failed unit (aurora-power-defaults.service, which fails the same way on the J713's default kernel: 0 new), and 1 error-level kernel message (apple_sep ... matching unavailable this boot, also present on the default kernel: 0 new). Across all 5 trial shutdown journals (4 read on the next trial boot, and the 5th read after returning to the default kernel), there were 0"power telemetry error"lines after shutdown began and each reached thesystemd-shutdownfilesystem-sync marker. This check is limited to what the journal records: journald stops before the last shutdown steps, so the console capture below is still needed to see the tail of shutdown.apple-pmp-thermal.kofrom this PR'sdrivers/thermal/apple-pmp-thermal.c(ab4cea3795f3, withapple_pmp_thermal_shutdown()) and loaded it into a runningrelease/7.3.0-40(9125b3147583) base kernel (whose own in-treedrivers/thermal/apple-pmp-thermal.cmatchesab4cea3795f3~1and lacks the.shutdownhook); power telemetry ran normally (power_statuserror=0) and the following reboot completed cleanly in ~10 s.Still to run
ab4cea3795f3(default command line): the shutdown console captured over 5 reboots and 5 power-offs (plus a clean 5th-reboot return to the default kernel if needed), confirming 0"power telemetry error"lines after shutdown starts, clean completion of each, andpower_statuserror=0on the next boot. (Cannot be run remotely: the J713 has no serial console attached for shutdown capture, and power-off cycles require physical power-on at the machine. The remote run above covered only the journal-visible part across 5 trial boots—4 trial-to-trial reboots plus a 5th shutdown whose return to the default kernel hung in the bootloader until power-cycled—and did no power-offs.)