Skip to content

thermal: apple-pmp: no Air power budget on the J604 - #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

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 the J604 and keeps the die guard as it is. The Airs and the other fan Macs (J773g, J623, J624) are unchanged (question 1).

Changes, on apple,j604 only:

  • 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 be8d4cd plus this commit, with #1888 (the J604 speaker enable) reverted locally so the test kernel keeps the speakers off; Stage 2: aura 1.0.0b12.1 + U-Boot aurora11. 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 at about 1 Hz 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, 14.0 W min (powermetrics: 23-25 W CPU, a different meter)
P+E rails, 5-15 min - about 17.6 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 2580 rpm at 20 s, 3710 at 120 s, 4460 at 170 s, about 5600 from 6 min, 5900 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, 102 °C over 15 min; max 109.5 °C (Tp0* max 110-113 °C)
after the load fan stays off fan runs down over about 70 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.4 W, die mean 104 °C, max 109.5 °C, fan 2550 -> 4790 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. The KUnit case builds; it was not run on a kernel.
  • Not tested: the Airs (their path is unchanged), J773g, J623, J624; 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. In one trial with the J604 guard 2 °C higher (not part of this PR), the same 180 s load gave 17.3 W P+E and 6200 rpm at 170 s, with a hottest sample of 110.75 °C.

Questions

  1. Only the J604 is measured. Should the J773g, J623 and J624 take the same path (e.g. !apple_t8132_air() or a helper in t8132.h), or stay on the budget until someone measures them?
  2. Should the J604 die guard regulate at the ADT target (110 °C), as the M4 Max zones do (5d70ddf), or throttle the E cluster less when only the P cores are hot? macOS keeps E at 2.81 GHz under this load.
  3. Would you prefer a per-board parameter set in pmp-power-policy.h (burst, sustainable power, regulation target) over a flag, if more boards will need a budget with different numbers?

Assisted-by: LLM

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 the J604 (MacBook Pro 14-inch, M4) that budget defeats the fan,
whose speed the SMC appears to set from the heat the SoC makes. 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.

The J604's ADT gives the J713's die sensors and limits (temp-sensor: a
110 C target and a 125 C maximum on Ta000m, Te000m, Te001m, Tp000m,
Tp001m, Tp002m), so the die guard applies as it is. Keep it and drop
the budget on the J604: 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. The Airs
keep the budget unchanged.

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-14 plus this commit:

                         stock           this commit
  P+E rails, 60-180 s    7.7 W mean      16.4 W mean
  fan target             0 from 72 s     never 0 once started;
                                         3710 rpm at 120 s, 4460
                                         at 170 s
  die, 60-180 s (1 Hz)   mean 80 C       mean 104 C, max 109.5 C

Over 15 minutes of the same load the fan reached about 5600 rpm at
6 min and 5900 at 15 min, the P and E rails about 17.6 W, the die a
102 C mean (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>
@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.

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