Repository navigation
thermal: apple-pmp: 200 ms cool slow poll on #3949 + #3766 - #3994
IronsideXXVI wants to merge 11 commits into
Conversation
…he GPU is idle The PMP firmware publishes a die record only while its CPU cluster has power. When every record is dark (`-ENODATA`), the driver reuses the last reading for a fixed 2 s (`APPLE_PMP_GATED_HOLD_NS`). On J604 (T8132), with cool polling slowed to 50-100 ms, an idle desktop routinely stays dark past 2 s, expiring the hold, logging repeated sensor errors, and clamping both CPU clusters at their floor while polling recovers. For a cool last reading (`< APPLE_PMP_GATED_HOLD_MC`), extend the dark hold past 2 s at 8 C/s of headroom below `APPLE_PMP_PASSIVE_MC` (clamped to [2 s, 10 s]: 8.25 s at 40 C, 6.5 s at 54 C, 2 s at >= 90 C), gated on the GPU rail (`PP1b`, sampled by the power worker every 500 ms) reading idle (`< 50 mW`, no error, timestamp <= 1 s old). Because every die record is a CPU record, the GPU rail gate prevents a busy GPU from heating the die unseen while CPU clusters are power-gated. Clear `rail_ns` on probe and across sleep (`apple_pmp_thermal_complete`) since `CLOCK_MONOTONIC` pauses during sleep. Non-`-ENODATA` errors, hot readings (`>= APPLE_PMP_GATED_HOLD_MC`), missing/stale/errored rail reads, GPU load (`>= 50 mW`), and dark spells past the scaled cap (10 s maximum) continue to take the stock fail-closed path immediately. Add KUnit coverage in `apple_pmp_test_dark_hold_gate`. Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
Integrate the dark-sensor hold with upstream main's apple-pmp-hold.h gated-hold helper, CPU idle tracker, sleep/resume real-sample-age tracking, and thermal-zone fault-disable handling: - Gate extended dark holds in apple_pmp_sample() on both cpus_idle and apple_pmp_gated_gpu_idle() (PP1b < 50 mW, error-free, <= 1 s fresh, with rail_ns cleared on probe, cleanup, and across sleep). - Bound apple_pmp_gated_hold_sample() by apple_pmp_gated_hold_ns(valid_mc) (8 C/s headroom below APPLE_PMP_PASSIVE_MC, clamped to [2 s, 10 s]) instead of a flat 15 s cap. - Update apple_pmp_test_gated_hold() and tools/asahi/pmp-thermal-poll-tests.py for the headroom-scaled cap and rail_ns sleep-resume reset. Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
…P1b debounce On quiet idle Apple T8132 desktops, two idle-efficiency issues remain in apple-pmp-thermal: 1. Cool idle dark spells with both CPU clusters power-gated and the GPU idle can cross the 15 s hold ceiling or observe a single transient compositor PP1b >= 50 mW sample, collapsing the hold to 2 s and triggering a -ENODATA sensor error with a 1.8 s 5 ms fast-poll recovery storm. 2. Cool polling (< 90 C) wakes every 100 ms even though apple_pmp_cooling_sample() accepts slope intervals up to 250 ms and Level-0 timer wheel slack at HZ=250 keeps 200 ms polling strictly within 204 ms. Make three bounded adjustments while keeping all hot/load fail-closed guards intact: - Add headroom-scaled GPU-gated dark holds via apple_pmp_gated_hold_ns() and apple_pmp_gated_hold_sample_capped(): a 2 C/s budget below 75 C capped at 30 s (<= 46 C) while CPU clusters and the GPU rail are idle, a 4 C/s budget at 75..90 C (7.75 s at 75 C, 5.25 s at 85 C), and immediate 2 s fail-closed at >= 90 C or on CPU/GPU load. - Track rail_ns on successful SMC power polls (cleared across sleep, cleanup, and probe) and add apple_pmp_gpu_gate_idle() to require two consecutive fresh PP1b >= 50 mW samples before collapsing an active cool (< 75 C) dark hold back to 2 s, failing closed immediately on warm dies (>= 75 C), sustained GPU load, non-dark reads, or missing/stale/errored SMC reads. - Add apple_pmp_poll_interval_ms() to poll at 200 ms below 90 C when not in fast poll, keeping 100 ms at 90..94.9 C (preserving the 100 ms transient SRAM glitch hold) and 5 ms at >= 95 C or during fault, cooling, or recovery. Extend apple-pmp-policy KUnit tests and pmp-thermal-poll-tests.py to cover 200 ms vs 100 ms vs 5 ms poll cadence, headroom-scaled 30 s cool holds, and 1-sample PP1b debounce vs 2-sample fail-closed. Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
There was a problem hiding this comment.
Review at ca69b4b55906. The GPU gate is an improvement on main, which holds a dark die for 15 s whatever the GPU does. At 75 C and above every hold is shorter than main's, and 95 C, faults and cooling still poll at 5 ms. Two paths are looser than the text says, and it overlaps two open PRs, so please take another round.
Must change
- The 90-95 C band gets the 200 ms poll on entry.
apple_pmp_slow_poll_work()queues the sample and re-arms with the oldslow_poll_msbefore that sample runs. I added that case to your poll harness: after a 92 C sample the next poll is still 200 ms away. From 94.9 C that is 200 ms unseen where main has 100 ms. #3949 fixes the cause, because it re-arms after the sample, so this should land on top of it and readslow_poll_msinapple_pmp_poll_reschedule(). - The first dark read after a wake now fails at once. With
rail_nscleared, the cap is 2 s from the last real read, not from the wake, soapple_pmp_gated_hold_resume()no longer does what its comment says. Replayed on the headers (40 C, 2 s dark, sleep, 1 s of suspend/resume time, dark read): main returns 0, #3766 returns 0, this returns -ENODATA, which caps the CPUs. Keepapple_pmp_gated_hold_ns(valid_mc)as the cap and let "GPU not idle" only start the 2 s clock, as #3766 does. - The longer hold needs a basis. Below 75 C the hold goes from 15 s to as much as 30 s at "2 C/s"; #3766 uses 8 C/s and 10 s. Neither number is measured. ANE, ISP and ProRes can heat a die whose CPU clusters are gated and whose PP1b reads under 50 mW. Please post the fastest rise measured in that state (ANE-only and ProRes-only, fanless and fan) and derive the budget from it.
Order: #3949, then #3766 (approved, J773g row queued), then this as a delta on both. Right now it conflicts with #3766 in 4 files, and in pmp-cooling.h the two merge without a conflict but both define apple_pmp_gated_hold_ns(), so it wouldn't build. It conflicts with #3949 in 2 files. If you'd rather this replaces #3766, say so on #3766 now, before its rows run.
Also: a board whose idle PP1b stays at or above 50 mW (an external display, for example) drops from a 15 s hold to 2 s. The J773g row has to show that doesn't bring the sensor-error caps back. The "100 ms at 90-95 C protects the transient hold" reason doesn't apply: below 100 C the 2 s hold covers it, and from 95 C the poll is 5 ms.
Checked on main 2c667a4b + this head: apple-pmp-thermal.o and apple-pmp-policy-test.o W=1 clean, apple-pmp-policy KUnit 17/17 (UML), pmp host tests 24/24, thermal 1/1, checkpatch --strict clean. Hosted CI shows as skipped at this head.
Rows at the next head: J773g (T8132): 30 min idle desktop on its display with PP1b logged and 0 sensor errors; idle to all-core and idle to GPU ramps vs base (peak C, time to first 5 ms poll); GPU load while the CPUs are dark; ANE-only and ProRes-only load from cool; 3 s2idle and 3 deep-sleep cycles with 0 sensor errors after wake. A fanless T8132 (J713 or J715) for the same ramps. Your J604 at the head. Other SoCs don't bind this driver.
Main already holds a cool dark die for up to 15 s while the CPUs are idle. Scaling that cap down to 2-10 s by headroom, and requiring a fresh idle GPU rail past 2 s, can only end a hold sooner. At 46 C the cap is 7.5 s, and each expiry costs sensor errors, capped CPUs and 5 ms polling until the sensors read again and the guard has stepped down. Over 10 idle minutes a J773g went from 78 to 371 "sensor error -61" lines and from 304.6 to 330.6 arch_timer interrupts per second. Go back to main's 15 s cap and keep the GPU gate, but let only a rail that reads busy start the 2 s clock. A failed or missing rail read leaves main's behaviour: the power policy already keeps the CPUs and the GPU at their floor for it. That also removes the rail timestamp: a stale reading can't hold the die longer than main does. Set the GPU threshold between what a J773g reads idle (0-43 mW) and under a light GPU load (1630 mW). 50 mW was within one 15 mW rail step of idle. The KUnit and host tests check that 10 idle minutes of 14 s dark spells cost no error and no fast poll. The host test also checks that mutations (a 7.5 s cap, a failed rail read that counts as GPU work, no GPU gate) are caught. Signed-off-by: DjDeveloperr <hey@djdev.me>
…urora-silicon#3994 Land slow_poll_ms on top of aurora-silicon#3949's single-hop delayed_work poll_work so apple_pmp_poll_reschedule() reads slow_poll_ms after apple_pmp_sample() updates it. Entering the 90-95 C warm band now switches the very next poll to 100 ms instead of waiting one stale 200 ms interval. Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
…to cool 200 ms slow poll Merge aurora-silicon#3766 (52e3af5, 250 mW GPU-busy dark-hold gate on top of main's 15 s APPLE_PMP_GATED_IDLE_CAP_NS) cleanly so aurora-silicon#3994 is a minimal delta on aurora-silicon#3949 + aurora-silicon#3766: - Drop the unmeasured 15 s -> 30 s dark-hold cap expansion (deferring any > 15 s extension until ANE-only and ProRes-only die ramp measurements are collected on fan and fanless T8132). - Drop the 50 mW rail_ns / apple_pmp_gpu_gate / apple_pmp_gated_hold_sample_capped() path, inheriting aurora-silicon#3766's apple_pmp_die_idle() (250 mW busy threshold, failed rail reads left on main's path) and apple_pmp_gated_hold_sample(), which also fixes the post-wake first dark read failure. - Keep cool-only 200 ms slow polling (< 90 C, 100 ms in 90-94.9 C on immediate entry via aurora-silicon#3949's apple_pmp_poll_reschedule(), 5 ms at >= 95 C, cooling, or fault) and clean up the inaccurate transient-hold comment. - Extend KUnit (17/17: cool poll cadence, 10-min 200 ms dark-idle rate = 3000 polls / 0 errors, post-wake dark-read replay) and host poll tests (including 92 C warm-band immediate 100 ms entry + mutation test). Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
|
Thanks for the thorough review, @DjDeveloperr. Addressed every point with two clean forward merges (
Offline verification at
|
Use 10ULL, 14ULL, and 600ULL when multiplying by NSEC_PER_SEC in apple_pmp_test_dark_idle_rate() so the multiplications do not overflow 32-bit signed long on 32-bit KUnit builds before converting to u64. Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
…e_rate() Use 10ULL, 14ULL, and 600ULL when multiplying by NSEC_PER_SEC in apple_pmp_test_cool_dark_idle_rate() so 32-bit KUnit builds do not overflow signed long before conversion to u64. Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
|
Forward-merged Verified offline at
|
RyanTheTide
left a comment
There was a problem hiding this comment.
The worker now chooses the next interval after sampling. That puts entry into the warm band on the 100 ms path immediately and keeps errors and active cooling at 5 ms. The longer dark-hold change was dropped, and the revised test widens its duration constants before multiplication. The exact hardware row is still pending.
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: approved at 872a79f1f6a9. The three points are answered. It merges after #3766 and the rows below.
Blockers: none in the code.
- Fixed: the worker re-arms after the sample and reads
slow_poll_msthere, so a 92 C sample schedules the next poll at 100 ms. - Fixed: the cap that ended the hold early is gone.
apple-pmp-hold.his byte-identical to #3766 at5d1e0cf98d21, and the post-wake replay is in KUnit. - Dropped: the idle cap stays 15 s.
Before it merges:
- #3766 first. Its J604 and J773g rows are open, and if it closes without a gain over main this needs to be redone without it.
52e3af5dd8acin this branch is our commit; this approval is for the part on top of #3766. - J773g at this head (we can run it): 30 min idle desktop with PP1b logged and the
sensor error -61count against main; idle to all-core and idle to GPU ramps against main (peak C, time to the first 5 ms poll); GPU load while the CPUs are dark; 3 s2idle and 3 deep-sleep cycles without sensor errors. - J604 at this head: the same idle count and ramps.
- A fanless T8132 (J713 or J715): the ramps. A 200 ms poll is twice as long unseen below 90 C, so this is the Mac that can show a worse peak.
Checked: the diff ca69b4b55906..872a79f1f6a9. tools/asahi/pmp-thermal-poll-tests.py from this head: pass, 4/4 mutations caught. Below 90 C is the only band that slows down; 95 C and above, faults and cooling still poll at 5 ms, and a guard error now does too. The three 64-bit constants are widened. Binds only on T8132, so no row on another generation.
Not blocking
Tested: and Not yet: still name c36b5a0d3.
|
J773g (Apple Mac mini M4, T8132, G16G B0, os-fw 27.2, 24 GB RAM) hardware row for head
Verdict: functional PASS; kit judge FAIL on pre-existing |
|
On the merge tree with main |
|
PEER-ROWS for J773g testing is routed to the lab. #3766 still needs to land first. |
|
Acknowledged — I have not run the exact base+ For context from earlier J604 integrated-kernel runs (neither is a substitute for the isolated exact-head row):
I will queue the isolated J604 A/B on the same base with |
|
J773g (Mac mini M4, T8132, OS fw 27.2 / 26B123) isolated A/B follow-up for exact head Setup & Isolation
Results Summary
Ramp Curves (temp from load start)
Key TakeawayActive-load ramp tracking ( |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Changes requested at 872a79f1f6a9. In the 30-minute J773g idle comparison with #3766 on both arms, the 200 ms poll increased 15-second all-dark hold expirations from 18 to 50 (2.7×) and 5 ms recovery cycles from 8,559 to 25,824 (3.0×). Total sample cycles rose from 25,446 to 33,852 (+33%), and -61 warnings rose from 169 to 482. The earlier 10 to 20 ramp warnings all came during cool-down. Active load and all three deep plus three s2idle cycles were clean.
Please make the smallest change that prevents the slower poll from driving those extra hold expirations while preserving fast recovery for genuine sensor faults. For example, keep the existing cadence during an active all-dark hold. We’ll repeat the isolated J773g idle comparison at the updated head. J773g results
In isolated 30-minute J773g idle testing against aurora-silicon#3766, slowing cool polling to 200 ms across active all-dark holds halved the number of probes inside the 15 s hold cap, increasing hold expirations from 18 to 50 (2.7x) and 5 ms error-recovery cycles from 8,559 to 25,824 (3.0x), raising total idle sample cycles by 33%. Pass whether the current sample is served from an active dark hold (`raw_ret && !ret`) into apple_pmp_poll_interval_ms() so cool polling only uses 200 ms on fresh readings (< 90 C) and keeps the existing 100 ms cadence while an all-dark hold is active. Genuine sensor faults, expired holds, cooling, recovery, and >= 95 C continue to take the 5 ms fast hrtimer path immediately. Extend apple-pmp-policy KUnit and tools/asahi/pmp-thermal-poll-tests.py (including a 5th mutation check that dark holds do not slow to 200 ms). Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
|
Thanks for catching that on J773g, @DjDeveloperr — that explains the 2.7× jump in 15 s hold expirations and 3.0× jump in 5 ms recovery cycles cleanly. Pushed forward-only commit
Offline verification at exact head
Ready for the repeat isolated J773g idle comparison at |
|
The cadence change matches the review finding. Fresh cool readings use 200 ms, held readings use 100 ms, and errors or active cooling still take the 5 ms path. I ran the poll host test and all five mutation checks successfully. The merge hold stays in place until the isolated 30-minute J773g idle comparison measures hold expirations, recovery cycles, total samples and sensor errors on the new build. The J604 comparison is with IronsideXXVI. |
|
J773g (Mac mini M4, T8132, OS fw 27.2 / 26B123) isolated 30-minute A/B follow-up at exact head Setup & Isolation
Exact-Head Comparison (
|
| Metric | Prior base3766 (05:25Z) |
Prior #3994 @ 872a79f1 |
Paired base3766 (09:08Z) |
New #3994 @ f4188ec0 |
Delta (f4188ec0 vs paired base) |
|---|---|---|---|---|---|
| Pure idle (120 s, untraced/unpolled) | sample=2,980 (24.83 Hz), gov=1,137, arch_timer=18,918 |
sample=2,206 (18.38 Hz), gov=592, arch_timer=19,337 |
sample=1,972 (16.43 Hz), gov=1,149, arch_timer=22,421 |
sample=2,335 (19.45 Hz), gov=1,119, arch_timer=25,749 |
+18.4% samples, -2.6% gov |
30 min idle (idle-30m) PP1b & state |
0/0/0/0 mW (1799/1799 valid, err=0, flt=0), both_idle=1777, temp_med=46.50 C |
0/0/0/0 mW (1799/1799 valid, err=0, flt=0), both_idle=1769, temp_med=46.50 C |
0/0/0/0 mW (1799/1799 valid, err=0, flt=0), both_idle=1779, cpu_busy=0.0153, temp_med=45.25 C |
0/0/0/0 mW (1799/1799 valid, err=0, flt=0), both_idle=1773, cpu_busy=0.0193, temp_med=45.75 C |
Matched quiet idle |
idle-30m total sample_count delta |
25,446 (14.143 Hz) |
33,852 (18.815 Hz, +33.0%) |
32,672 (18.159 Hz) |
40,967 (22.769 Hz) |
+25.4% (still above base) |
idle-30m governor_count / arch_timer |
17,222 (9.572 Hz) / 316,656 (175.99 Hz) |
8,953 (4.976 Hz, -48%) / 298,065 (165.66 Hz) |
17,096 (9.502 Hz) / 276,744 (153.81 Hz) |
16,861 (9.371 Hz) / 303,017 (168.41 Hz) |
-1.4% gov, +9.5% arch_timer |
idle-30m 15 s hold expirations (>=15 s all-dark spans) |
18 (max 16.895 s) |
49 (max 23.674 s) |
30 (max 19.114 s, 31 5 ms bursts) |
43 (max 20.295 s, 50 5 ms bursts) |
+43.3% expirations (+61% bursts) |
idle-30m 5 ms recovery cycles (<=15 ms) |
8,559 (~42.8 s = 2.4%) |
25,824 (~129.1 s = 7.2%) |
16,151 (~80.8 s = 4.5%) |
25,034 (~125.2 s = 7.0%) |
+55.0% 5 ms recovery cycles |
idle-30m 100 ms / 200 ms cycles |
16,886 / 0 |
0 / 8,027 |
16,520 / 0 |
15,772 / 160 |
100 ms restored on cached dark |
idle-30m raw -61 (ENODATA) reads |
150,771 (5,027.8/min) |
201,034 (6,704.0/min) |
194,230 (6,477.1/min, 5,944.9/1k cyc) |
243,811 (8,130.5/min, 5,951.4/1k cyc) |
Identical per-cycle -61 rate |
True sensor errors (non--61) / fatal klog |
0 / 0 (ret_other_neg=0) |
0 / 0 (ret_other_neg=0) |
0 / 0 (ret_other_neg=0) |
0 / 0 (ret_other_neg=0) |
0 true sensor errors; all klog errs are -61 expiry warns (556 vs 334 in idle-30m; 648 vs 400 full boot) |
Full-boot sample_count (end of sleeps) |
— | — | 48,255 (idle30m: 3,489 -> 36,161) |
57,923 (idle30m: 3,291 -> 44,258) |
+20.0% full-boot total |
CPU ramp (20 s pre + 60 s 10-core + 90 s cool) |
peak 106.00 C, t_5ms=26.609 s |
peak 106.25 C, t_100ms=17.985 s, t_5ms=27.047 s |
sample=7,306, peak 105.50 C, t_5ms=29.838 s, 0 klog errs |
sample=8,437, peak 105.50 C, t_100ms=19.874 s, t_5ms=29.457 s, 24 cool-down -61 warns |
Clean 200->100->5 ms ramp (1,313 cool-down 5 ms cyc on head vs 2 on base) |
GPU-only (90 s gpubench-vk render.heavy) |
PP1b med=22,134 mW, peak 87.25 C, 872 load cyc (104 ms) |
PP1b med=22,039 mW, peak 87.25 C, 437 load cyc (208 ms) |
PP1b med=22,178 mW, peak 85.75 C, 877 load cyc (104 ms), 0 dark >=2 s |
PP1b med=22,146 mW, peak 86.25 C, 534 load cyc (208 ms med: 339 at 200 ms, 195 at 100 ms), 0 dark >=2 s, status=ok, valid=True, 89.19 Gpix/s |
-39% GPU load poll cycles |
Sleeps (3 s2idle + 3 deep) |
3/3, 3/3, 0 errs |
3/3, 3/3, 0 errs |
3/3, 3/3, 0 errs |
3/3, 3/3, 0 errs |
Clean wake resumption |
Cadence Breakdown (idle-30m ftrace: interval following fresh vs all-dark sample)
base3766:- After fresh sample:
100 ms = 272,200 ms = 0,5 ms = 324 - After all-dark (
-61) sample:100 ms = 16,248,200 ms = 0,5 ms = 15,827
- After fresh sample:
head3994 @ f4188ec0:- After fresh sample:
100 ms = 0,200 ms = 160,5 ms = 457 - After all-dark (
-61) sample:100 ms = 15,772,200 ms = 0,5 ms = 24,577
- After fresh sample:
Takeaway
- Cadence behavior works as intended on
f4188ec0:100 msis preserved on every cached all-dark sample (15,772at100 ms,0at200 ms),200 msis used after fresh cool samples (160inidle-30mand339/534during cool GPU load),governor_countis restored (9.371 Hzvs9.502 Hz,-1.4%vs-48%at872a79f1), active CPU/GPU ramps and6/6sleeps pass cleanly, and true (non--61) sensor errors are0. - Idle sample count on J773g: In this 30-minute run,
head3994 @ f4188ec0still recorded+25.4%more totalidle-30msamples than its pairedbase3766(40,967vs32,672, with43vs30>=15 shold expirations and25,034vs16,1515 msrecovery cycles), compared with+33.0%at872a79f1. Note that J773g idle dark-span frequency also has substantial run-to-run variance even on unmodified#3766(base3766itself moved from18to30>=15 sexpirations and25,446to32,672samples between the05:25Zand09:08Zruns), and on quiet J773g idle only0.39%(160 / 40,966) of cycles take the200 mspath (the single step immediately following a fresh reading before returning to100 mswhile dark-held).
|
Thanks for running the isolated 30-minute J773g A/B at Looking at both J773g runs alongside our J604 behavior,
Unless you think the active-GPU-only |
|
Agreed, please close #3994 and keep the 100 ms slow poll. At |
|
Closing as agreed — keeping main's 100 ms slow poll. |
What: Add a cool-only
200 msslow poll cadence (< 90 C) toapple-pmp-thermalon Apple T8132, landed cleanly on top of#3949(single-hopdelayed_work poll_work) and#3766(52e3af5dd8ac,250 mWGPU-busy dark-hold gate on top ofmain's15 scap):200 msslow poll (< 90 C): Addapple_pmp_poll_interval_ms()ininclude/linux/soc/apple/pmp-cooling.handslow_poll_msindrivers/thermal/apple-pmp-thermal.cso settled cool polling (< 90 C,!fast_poll) runs at200 ms(50 jiffies atHZ=250, Level-0 timer wheel,<= 204 ms, strictly insideapple_pmp_cooling_sample()'s50-250 msslope window), while keeping100 msin90..94.9 Cfor tighter ramp tracking approaching95 Cand5 mshrtimer polling at>= 95 Cor during error, cooling, or recovery.100 msentry on90..94.9 C: Built on#3949's single-hopdelayed_work poll_worksoapple_pmp_poll_reschedule()readsslow_poll_msafterapple_pmp_sample()updates it. Entering90..94.9 Cfrom a cool200 mspoll schedules the very next poll at100 ms(never a stale200 ms).probe(),setup(),change_mode(), andprepare()initializeslow_poll_msconservatively to100 ms.#3766/main's15 sdark hold and250 mWGPU gate: Drops the earlier unmeasured30 sdark-hold cap expansion and50 mWrail_ns/debounce path; inherits#3766 @ 52e3af5dd8ac'sapple_pmp_die_idle()andapple_pmp_gated_hold_sample()verbatim so post-wake dark reads hold identically tomainand#3766.apple-pmp-policyKUnit (17/17, addingapple_pmp_test_cool_poll_intervalandapple_pmp_test_cool_dark_idle_rate:0errors and3000polls across 10 idle minutes + post-wake dark-read replay) andtools/asahi/pmp-thermal-poll-tests.py(all#3949single-hop invariants,#3766dark_sensor_tests(),92 Cimmediate100 msentry test, and4/4mutation checks).Tested:
c36b5a0d3(clean forward merges of#3949 @ 564e67a67c6band#3766 @ 52e3af5dd8acintoj604/apple-pmp-cool-poll-dark-hold, 0 merge-tree conflicts againstorigin/main):scripts/checkpatch.pl --strict:0errors,0warnings,0checks (905lines checked).LLVM=1 W=1 KCFLAGS="-Werror":drivers/thermal/apple-pmp-thermal.o(343168bytes):0warnings,0errors.drivers/thermal/apple-pmp-policy-test.o(274792bytes):0warnings,0errors.apple-pmp-policy(KASAN+UBSAN):17/17PASSED (0failed).python3 tools/asahi/pmp-thermal-poll-tests.py,-Wall -Wextra -Werror -fsanitize=undefined):PASS+4/4mutations caught (7.5 scap, failed rail read counts as GPU work, GPU work does not end hold, warm band stays at200 ms).linux-aurora 7.3.0.aurora1-1.1687(carrying200 mscool polling alongsidesched/topology,0kernel faults):pmp_scwakeup rate halved9.61 -> 4.89/s,PMPEV events=0 supp=0 serr=0, idle die33.8 C, deep-sleep wakerc=0.n=10): median114.58 -> 112.44/s(pmp_sc 4.90/sacross 11/12 windows);PHPCidle730.5 -> 681.5 mW(-49.0 mW),PMVR2071.0 -> 1979.9 mW(-91.1 mW).Risk: two-way door · M4 (T8132)
apple-pmp-thermal. Stacked cleanly on#3949+#3766 @ 52e3af5dd8ac(5files total relative tomain;#3994's own delta over#3949 + #3766is onlyapple_pmp_poll_interval_ms()+slow_poll_ms+ tests). Preserves5 msfast hrtimer polling at>= 95 C/ cooling / fault, immediate100 mspolling on entry to90..94.9 C,15 scool idle hold,2 sbusy / active-GPU (>= 250 mW) hold, and post-wake hold behavior; a plain revert restores100 mscool polling.Not yet:
#3949, then#3766, then#3994(both merged forward here so the branch builds and tests cleanly as a delta).c36b5a0d3) bare-metal hardware rows: J604, J773g (30 min idle desktop withPP1blogged and0sensor errors, idle->all-core and idle->GPU ramps vs base, GPU load while CPUs dark, 3s2idle+ 3 deep-sleep cycles), and fanless T8132 (J713/J715) ramps.> 15 sdark-hold extension is deferred to a separate PR once ANE-only and ProRes-only die ramp rates are measured on fan and fanless T8132.Details and verification
Scope (
j604/apple-pmp-cool-poll-dark-hold, headc36b5a0d3)#3949(564e67a67c6b, commit1e1c8e8f3) and#3766(52e3af5dd8ac, commitc36b5a0d3), zero force-push.drivers/thermal/apple-pmp-hold.h: identical to#3766 @ 52e3af5dd8ac.include/linux/soc/apple/pmp-cooling.h: addsAPPLE_PMP_POLL_MS(5U),APPLE_PMP_SLOW_POLL_MS(100U),APPLE_PMP_COOL_POLL_MS(200U),APPLE_PMP_COOL_POLL_MC(90000), andapple_pmp_poll_interval_ms().drivers/thermal/apple-pmp-thermal.c: setsslow_poll_msfromapple_pmp_poll_interval_ms()inapple_pmp_sample()and reads it in#3949'sapple_pmp_poll_reschedule(), resetting to100 msinprobe(),setup(),change_mode(), andprepare().drivers/thermal/apple-pmp-policy-test.c:17/17KUnit (KASAN+UBSANARM64 QEMU PASS).tools/asahi/pmp-thermal-poll-tests.py:PASS+4/4mutations caught.scripts/checkpatch.pl --strict:0 errors, 0 warnings, 0 checks(905lines checked).LLVM=1 W=1 KCFLAGS="-Werror":apple-pmp-thermal.o(343168B) andapple-pmp-policy-test.o(274792B),0warnings,0errors.