Repository navigation
thermal: apple-pmp: ride out long 27.2 dark spans while the SoC is idle (J713, stacked on #2533) - #2554
Merged
Conversation
On the 27.2 firmware a cool, idle J713 keeps all six PMP sensors invalid far longer than the 2 s hold sized from 26.6.2 (0.46 s worst case there): sampled at the driver's own 100 ms, 86% of samples were all-dark and the longest span was 13.3 s. Each span past 2 s latches the minimum CPU caps again, and the recovery climbs back over seconds, so the machine spends most of its time well below its clocks. Keep going from the last cool reading for up to 30 s, but only while the SMC's measured P, E and GPU rails, read within the last 1.5 s, add up to under 500 mW. A dark cluster is powered down; the rail reading is the independent proof that nothing is drawing power while the sensors are dark. The 2 s hold and every other limit are unchanged. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
7 tasks
DjDeveloperr
approved these changes
Nov 20, 2026
DjDeveloperr
left a comment
Contributor
There was a problem hiding this comment.
Approving. On thermal safety the hold reads right to me:
- It only covers a sample where all six records are dark (
-ENODATA). If any record is valid, or any other error comes back, the hold is skipped (apple-pmp-thermal.c:442). - Only a reading below 90 C (
APPLE_PMP_GATED_HOLD_MC) is held, and never for more than 30 s after it was taken. - The idle proof is a successful SMC read from the last 1.5 s showing P + E + GPU < 500 mW (
:418-423). A failed, all-zero or out-of-range read is never recorded (:200,:235,:242). If the SMC breaks, the proof ages out within 1.5 s and the driver drops back to the 2 s hold and then fails closed, as it does today. - Under load the hold ends at the first rail read that shows the load, or at the 1.5 s staleness limit if reads fail. That means CPUs run on a held value for at most 1.5 s, which is shorter than the 2 s blind hold the driver already accepts.
- Critical shutdown is unaffected: a dark sample never counted toward it, and any held value is below 90 C.
None of these block the approval:
- Description fix: the rail poller also runs on the Mac mini. #2533 turns the mini's budget off but still reads the rails (
:276,:800-801). Soidle_rail_nsgets set on J773g and the 30 s idle hold applies there too. That fits the no-gates rule, but nobody has tested it on the mini. Please fix that sentence, and the mini lane should take a row when it folds this in. - Optional: clear
idle_rail_nsin probe next tovalid_ns(:850) and inapple_pmp_thermal_prepare()(:869). Then the long hold always needs a rail read from the current bind or wake.ktime_get_ns()doesn't count suspend time, so a rail read from before a sleep can look fresh right after resume. The die only cools while asleep, so this is tidiness, not a hazard. - For the soak you list: if the SMC rail keys are filtered, a load step will show up late. Please include a step from idle to full load out of a long dark span, and log how long the held value survives after the step.
CI: no workflow ran on 422bc70, because host-tests only triggers for PRs into integration/aurora or aurora-wip. I've noted your local W=1 build. CI will run once this is folded in.
Not merging: #2533 is the M4 mini lane's draft, and that branch may still move. This folds into #2533 once it's finalized.
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.
Stacked on #2533 (base
djdev/t8132-pmp-272). Please review only the last commit; if #2533 merges first this retargets tointegration/auroraas one commit.Problem
On the macOS 27.2 (26B123) firmware, an idle 13" M4 MacBook Air (J713) keeps all six PMP temperature records invalid for much longer than the 2 s hold that was sized from 26.6.2 (0.46 s worst case there). With #2533 the driver finds the 27.2 records, but every dark span past 2 s returns
-ENODATA("sensor error -61"), the CPU caps drop to the minimum OPP and climb back over seconds. Result on the J713 with #2533 alone: 165 x "sensor error -61" in 150 s,scaling_max_freqstuck at 912000 / 900000, cpu0 measured at 900.6 MHz.Change
thermal: apple-pmp: ride out long dark spans while the SoC is idle: keep the last cool reading (still below the existingAPPLE_PMP_GATED_HOLD_MC) for up to 30 s, but only while the SMC's measured P + E + GPU rails, read no more than 1.5 s ago, add up to under 500 mW. A dark cluster is powered down; the SMC rail reading is the independent proof of that. The 2 s hold, the temperature ceiling for any hold, and every other limit are unchanged. Where the rail poller does not run (no SMC rail budget, e.g. the Mac mini after #2533's first commit),idle_rail_nsstays 0 and only the 2 s hold applies, as before.Testing (J713, Mac16,12, 27.2 stub, aura Stage 2 c0a50c00, kernel = integration 0abc2f3 + linux#2189 + #2205 + #2533 + this)
make W=1 drivers/thermal/apple-pmp-thermal.o(LLVM, J713 config) clean; checkpatch --strict 0/0/0.Still to run
Measurement detail
Assisted-by: LLM (Claude:Opus 5.5)