Skip to content

thermal: apple-pmp: no Air power budget on fan-cooled boards - #1971

Open
aeries0x wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
aeries0x:j604-power-policy
Open

aeries0x wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
aeries0x:j604-power-policy

Conversation

@aeries0x

@aeries0x aeries0x commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

On the J604 (MacBook Pro 14-inch, M4), apple-pmp-thermal applies the fanless Airs' energy budget: a 600 J burst at up to 20 W, then 8 W regulated toward an 85 °C filtered die, with a 4 W floor. The SMC appears to set the fan speed from the heat the SoC makes, so under a sustained all-core load the budget starves the fan: it stops during the load and the CPU stays at 5-9 W (7.7 W mean). #1931 reports the same on another J604.

This PR drops the budget on every board whose device tree describes a fan, and keeps the die guard as it is. A board counts as fan cooled when a child of the SMC hwmon node has apple,fan-maximum. On the current T8132 DTs that is the J604, the J623 and J624, and the J773g; the J713 and J715 keep the budget.

Changes on those boards:

  • apple_pmp_power_init_unbudgeted(): the rails are still read and reported (power_status shows budget=0, the hwmon sum channel is labelled "CPU/GPU rail sum"). A rail fault or a telemetry gap still selects full protection and recovers one step per second; sustained power never restricts.
  • The die guard is untouched (cooling from 106 °C, target 110 °C, full protection 115 °C, shutdown after three samples at 120 °C). The J604 ADT's temp-sensor has the J713's limits: 110 °C target and 125 °C maximum on Ta000m, Te000m, Te001m and Tp000m-Tp002m.
  • The release loop moves into apple_pmp_power_release(), shared by both paths; the Airs run the same arithmetic as before.
  • A KUnit case covers the unbudgeted path: no burst credit, one release step per second, no restriction under a sustained 36 W load on a hot die, full protection and stepwise recovery after a fault, full protection on a gap.

Tested

J604 (Mac16,1, Linux stub on the 26.6.2 OS firmware), AC, power profile performance. Kernel: integration/aurora 50c5079 plus this commit, with #1888 (the J604 speaker enable) reverted locally so the test kernel keeps the speakers off; Stage 2: aura 1.0.0b13.1 + U-Boot aurora11. The boot log shows the DT selection: apple-pmp-thermal: T8132 provisional policy: ... no power budget (fan cooled; rail faults still restrict). Stock: Aurora's linux-aurora 7.3.0.aurora1-37 package with aura 1.0.0b13.1 (same budget logic as this base). Load: ten shell busy loops after two minutes idle, sampled every 1-4 s from sysfs. No SMC writes. "P+E" is PP0b + PPbb, without the GPU rail.

ten busy loops stock this PR macOS 27.2, same Mac
P+E rails, 60-180 s 7.7 W mean, 5.1 W min 16.4 W mean, 15.4 W min (powermetrics: 23-25 W CPU, a different meter)
P+E rails, 5-15 min - about 17.4 W -
P / E cluster, median 60-180 s 2.09 / 2.50 GHz 3.47 / 2.17 GHz 3.78-3.94 / 2.81 GHz
fan target 2500 rpm at 20-60 s, 0 from 72 s 2560 rpm at 20 s, 3630 at 120 s, 4400 at 170 s, about 5600 from 6 min, 5970 at 15 min; never 0 once started 2500 rpm at ~20 s, 6550 rpm by ~110 s
die (PMP hotspot) mean 80 °C at 60-180 s mean 104 °C at 60-180 s, 101.5 °C at 5-15 min; max 108.75 °C sampled, 110.25 °C in the driver log (Tp0* max 110-113 °C)
after the load fan stays off fan runs down over about 73 s fan at about 3100 rpm 60 s after
  • Busy loops plus GPU compute (gpubench compute.heavy, depth 8) for 180 s: P+E 12.7 W, GPU 5.2 W, die mean 104 °C, max 108.75 °C sampled (110.5 °C in the driver log), fan 2500 -> 4860 rpm, never 0; no GPU or other new error in the kernel log.
  • At idle the fan is off. No thermal-driver or telemetry error in any run. Battery hotspot TB0T at most 29.5 °C, charge regulator TCHP at most 47.2 °C (macOS: 43.5 °C).
  • checkpatch --strict and a W=1 LLVM build of both changed files: clean. Aurora's host tests: same results as the base. KUnit (kunit.py run --arch=arm64, QEMU): apple-pmp-policy 8/8 passed.
  • Not tested: the Airs (their path is unchanged), J773g, J623, J624 (they now take the unbudgeted path); battery power and the other power profiles; loads longer than 15 minutes or GPU loads above about 6 W; suspend/resume; a real rail fault (only in KUnit); a blocked fan; lid closed.

Without the budget, the die guard sets the limit. It steps both clusters together and its 108 °C backstop reacts to short peaks, so under this load P runs at about 3.47 GHz and E at 2.17 GHz.

Assisted-by: LLM

@davishann15-commits

Copy link
Copy Markdown

Tested on a second J604: the Mac from #1931, with OS firmware 26.6.2 like yours. With this PR the fan runs for the whole load, and P+E holds about 13.7 W where the stock budget allowed 7.7 W.

Method as yours: ten shell busy loops after 120 s idle, held for 180 s, sampled at about 1 Hz from sysfs and the power_status parameter, with no SMC writes. "P+E" is PP0b + PPbb. The Mac was on AC with power profile balanced (yours was performance). Both rows are one boot each of the same tree: alarm-aurora's pkgrel 38 recipe on integration/aurora 0b03fe4, plus #1543, #1895, #1917, #1918, #1919 and #1922. The second boot adds this PR (1df8dfb, applied cleanly). The speaker enable (#1888) stays in, with speakerguardd v2. Stage 2: aura 1.0.0b13.1 + U-Boot aurora11.

ten busy loops, 180 s stock (same tree, no PR) this PR
P+E rails, 0-60 s 17.1 W mean 17.7 W mean
P+E rails, 60-180 s 7.7 W mean, 5.1 W min 13.7 W mean, 12.9 W min
P / E cluster, median 60-180 s 2.35 / 2.50 GHz 3.30 / 2.17 GHz
fan (F0Ac, actual) 2500 rpm from 21 s while the 600 J credit lasts, then 0 for 106 of the remaining 155 s on at 13 s: 2546 rpm at 60 s, 3007 at 120 s, 3612 at 170 s, never 0 once started
die (PMP hotspot) mean 82 °C at 60-180 s, max 105 °C (in the burst) mean 104.5 °C at 60-180 s, max 108.5 °C
total system power (SMC), 60-180 s 24.3 W 32.3 W
after the load fan stays off 3712 rpm at the stop, about 2500 rpm 30 s and 60 s later
  • Stock: after the credit runs out, allowed_mw sits at 6.2-9.5 W and p_level at 4-6. That matches your stock row exactly (7.7 W mean, 5.1 W min), so both Macs behave the same.
  • This PR: power_status shows budget=0 and the hwmon channel reads "CPU/GPU rail sum". dmesg has no power budget (fan cooled; rail faults still restrict). Levels stayed at 0, and the die guard did the limiting. At idle the fan is off. No thermal-driver, telemetry or GPU errors, and nothing new in the kernel log.
  • For question 2: here too the E cluster runs lower with the PR than on stock (2.17 vs 2.50 GHz) while P runs much higher. So the guard stepping both clusters costs the E cores about 0.3 GHz under this load.
  • Compared with your row, P+E is about 2.7 W lower and the fan rises more slowly (3612 vs 4460 rpm at 170 s). That may be the balanced profile; I didn't run performance.
  • Not tested: loads longer than 180 s, GPU load, battery power, other power profiles, suspend/resume.

This fixes what I reported in #1931 on this Mac. I'll close that issue once this lands.


Disclosure: an LLM (Claude) ran these boots and measurements on my Mac and drafted this. I reviewed it and am responsible for it.

Assisted-by: LLM

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for the clear write-up and the J604 measurements.

In this tree we select behaviour by a hardware property rather than a machine list. The new policy is chosen by of_machine_is_compatible("apple,j604") (drivers/thermal/apple-pmp-thermal.c:692-695, used at :710). The reason it applies is that the machine has a fan, and that is true of other T8132 boards with fans as well.

Could the "unbudgeted" policy be selected from the device tree instead? For example, it could apply when the SMC hwmon node describes a fan (the J604 one-fan description in #1953 adds exactly that), or when a small apple,fan-cooled property is on the PMP thermal node. Then the fanless Airs keep the budget and every fan-cooled board gets the J604 behaviour without being listed.

If it helps, we can run thermal rows on our fan-cooled M1 Pro and M4 Pro to check that the shared policy code is unchanged there.

@RyanTheTide

Copy link
Copy Markdown
Contributor

The two J604 rows here, yours and the one from #1931, show the budget is what stops the fan. With this PR P+E holds 13.7 W where it was 7.7 W, and the fan keeps running.

One request on how the policy is chosen. The reason for dropping the budget is that the machine has a fan the SMC runs on the SoC's heat. That is a property of the hardware, and the device tree already describes it: the fan node under smc_hwmon (fan-F0Ac with apple,fan-minimum/apple,fan-maximum, from hwmon-fan.dtsi). Can apple_pmp_unbudgeted() look for that node instead of of_machine_is_compatible("apple,j604")? For example, any child of the SMC hwmon node with apple,fan-maximum. On the current T8132 DTs:

  • J604 includes hwmon-fan.dtsi, so it is selected (no change from this PR).
  • J623/J624 (iMac) include it too. They would drop the budget as well, which fits the reason. A row on one of them would be good, but the die guard stays in place either way.
  • J773g (Mac mini) has a fan but no fan node yet. It keeps the budget until its DT describes the fan, and adding that node is the fix for it.
  • J713/J715 (Airs) have no fan node and keep the budget.

That keeps the policy tied to what the board has, so it does not grow into a board list as more fan machines run on this driver. The KUnit case does not need to change.

The T8132 PMP thermal driver runs one policy on every M4 Mac on the
firmware path: the die guard (cooling from 106 C, target 110 C, full
protection 115 C, shutdown after three samples at 120 C) plus the
fanless MacBook Air's measured-rail energy budget, a 600 J burst at up
to 20 W, then 8 W regulated toward an 85 C filtered die with a 4 W
floor.

On a Mac with a fan that budget defeats the fan, whose speed the SMC
appears to set from the heat the SoC makes. On the J604 (MacBook Pro
14-inch, M4), with ten busy loops for 180 s on Aurora's linux-aurora
7.3.0.aurora1-37 package, the burst ran out after 53 s, the P and E
rails (PP0b + PPbb) fell from up to 22.7 W to 5-12 W, the heatpipe
power (PHPC) from up to 28 W to 8-17 W, and 19 s later the SMC set the
fan target to 0 for the rest of the load. macOS 27.2 on the same Mac,
same load: the fan ramps from 2500 rpm to its 6550 rpm maximum and
never stops.

Drop the budget on every board whose device tree describes a fan: a
child of the SMC hwmon node with apple,fan-maximum. On the current
T8132 device trees that is the J604, the J623 and J624 (iMac) and the
J773g (Mac mini); the J713 and J715 (Air) have no fan node and keep
the budget. The die guard stays on every board: the rails are still
read and reported, a rail fault or a telemetry gap still selects full
protection and recovers one step per second, but sustained power no
longer restricts.

Tested on a J604 whose Linux stub runs the 26.6.2 OS firmware, AC,
power profile performance, the same load; stock is Aurora's
linux-aurora 7.3.0.aurora1-37 package, "this commit" is
integration/aurora of 2026-11-20 plus this commit (the device tree
selected the unbudgeted path: "no power budget (fan cooled; rail
faults still restrict)"):

                         stock           this commit
  P+E rails, 60-180 s    7.7 W mean      16.4 W mean, 15.4 W min
  fan target             0 from 72 s     never 0 once started;
                                         3630 rpm at 120 s, 4400
                                         at 170 s
  die, 60-180 s (sysfs)  mean 80 C       mean 104 C, max 107.5 C

Over 15 minutes of the same load the fan reached about 5600 rpm at
6 min and 5970 at 15 min, the P and E rails about 17.4 W, the die a
101.5 C mean (highest logged sample 108.75 C, highest sample in the
driver log 110.25 C). At idle the fan is off. The CPU is now held by
the die guard, not by power.

Assisted-by: LLM
Signed-off-by: Friedrich <261542475+aeries0x@users.noreply.github.com>
@aeries0x aeries0x changed the title thermal: apple-pmp: no Air power budget on the J604 thermal: apple-pmp: no Air power budget on fan-cooled boards Nov 20, 2026
@aeries0x

Copy link
Copy Markdown
Contributor Author

Updated in 8c9ec70: apple_pmp_unbudgeted() now checks for an available child of apple,smc-hwmon with apple,fan-maximum, and the apple,j604 check is gone.

On the current T8132 DTs that selects the J604, J623 and J624, and also the J773g. You mentioned the J773g has no fan node yet, but t8132-j773g.dts includes hwmon-mini.dtsi, which pulls in hwmon-fan.dtsi (fan-F0Ac with apple,fan-maximum, since 695332a). So the J773g drops the budget too, while the J713 and J715 have no fan node and keep the budget.

Re-tested on the J604 at this head; the PR description has the full table. The boot log shows the DT selection ("no power budget (fan cooled; rail faults still restrict)"). Under ten busy loops, P+E held 16.4 W at 60-180 s (stock: 7.7 W) and 17.4 W at 5-15 min, with the fan reaching 5970 rpm and never stopping. CPU+GPU for 180 s gave P+E 12.7 W and GPU 5.2 W with no errors. KUnit apple-pmp-policy passed 8/8 on arm64 QEMU.

The M1 Pro and M4 Pro won't reach this code, since apple-pmp-thermal only probes on T8132. A J773g, J623 or J624 row would be the useful one.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for 8c9ec70, and for the correction about the J773g: hwmon-mini.dtsi does pull in the fan node, so it drops the budget too, which fits the reason. Selecting by an available fan with apple,fan-maximum is the hardware property we hoped for, and the J604 rows on this head look good. A J773g or iMac row from an owner would be the useful extra check; we have none of those boards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants