Skip to content

J514S (M3 Pro 14"): CPU energy model, die sensors, critical thermal zones, SoC die keys - #481

Open
ilyasakin wants to merge 4 commits into
omacom:integration/aurorafrom
ilyasakin:m3pro-thermal
Open

ilyasakin wants to merge 4 commits into
omacom:integration/aurorafrom
ilyasakin:m3pro-thermal

Conversation

@ilyasakin

@ilyasakin ilyasakin commented Nov 15, 2026 •

Copy link
Copy Markdown

What this changes and why

Thermal support for the J514S (MacBook Pro 14", M3 Pro, T6030). It follows #146 (J613), except for the thermal zones: this machine has fans.

  • Patch 1 (dtsi, t6030): opp-microwatt for every OPP of both clusters. Until now T6030 had no CPU energy model. The values were measured through the SMC's cluster power keys (PPMC, PP0C): the cluster pinned to each state, all of its CPUs busy minus the cluster idle, divided by the CPU count. They are fitted to a curve so they rise monotonically. From 3576 MHz up, the P cluster tops out at about 19.5 W with all five CPUs busy; those states get the extrapolated curve. With the energy model, energy-aware scheduling turns on (sched_energy_aware = 1 with schedutil).
  • Patch 2 (dtsi, t6030): #cooling-cells on the CPUs, as on t8122, and seven SMC die sensors as the first hwmon temperature channels:
    • For each P core, the key that rose most with only that core busy: Tp0U, Tp0a, Tp1I, Tp1Q, Tp0g for cpu@10100..10104. Each rose about 25 °C, 10-15 °C more than with any other core busy.
    • Te05 and Te0P for the E cluster.
    • cpu@10105 is absent on the 11-core part, so its key is not identified.
  • Patch 3 (DT, j514s): one thermal zone per die sensor, with only a critical trip at 110 °C (as on the J613), polled every second. There are no passive trips and no cooling maps; see "Why no power allocator" below.
  • Patch 4 (macsmc-hwmon): a J514S board entry.
    • Die keys: the seven CPU keys from patch 2, plus Tf24, Tf28, Tf29, Tf2E, which rose 11-14 °C with only the GPU busy and about 1 °C with all P cores busy.
    • The GPU's own Tg keys read 0 °C or slightly below on this machine even while it renders, so they are left out.
    • Pressure key: mTPL.

Patches 1 and 2 are in t6030.dtsi, which the J516S (16" M3 Pro) also includes (see Risk). Patches 3 and 4 only touch the J514S.

Why no power allocator

The SMC runs the fans and keeps the chip in range by itself. I first used #146's design, a power_allocator zone per sensor, and tuned it with load tests. With trips below the fans' working point (70/95 °C or 80/90 °C), the governor cut power before the SMC raised the fans:

  • the fans stayed near 2300 rpm;
  • the P cluster swung between 696 MHz and 4056 MHz, averaging about 3.1 GHz.

Two more problems with this approach:

  • A wide switch-on to control gap (50/85 °C) leaves the throttle stuck. Smaller gains do smooth the control. But the PID integral only builds up while the chip is above the control temperature, and it resets only below switch-on. So after one overshoot the P cluster stayed throttled at 1884 MHz with the sensor at 75 °C. This is the behaviour described in the January 2026 linux-pm RFC "thermal: power_allocator: Ignore cutoff when integral is less than zero", which is not merged.
  • A narrow gap (70/85 °C) oscillates. The temperature swung about ±8 °C and the P cluster swung between its lowest and highest clock.

The closest upstream precedent is the Qualcomm X1E laptops: commit 06eadce "arm64: dts: qcom: x1e80100: Drop unused passive thermal trip points for CPU" left their CPU zones with a critical trip only, "as safety measure in case the throttling fails". This PR does the same. Mainline and the Asahi tree have no CPU zones for any Mac with fans; the two in this tree, J613 and J700, are fanless.

What was tested (J514S, MacBook Pro 14" M3 Pro, 11-core, 36 GB)

Was a kernel built from THIS commit booted? Yes:

  • 0b16569a9 was built with the omarchy-pkgs linux-aurora recipe (omarchy-pkgs fb18a8a), pointed at the commit with tools/aurora-ci/prepare-recipe.py, as 7.2.11.aurora16-1.1.
  • The package was installed and booted. omarchy-apple-silicon-boot-check --boot-chain passes.
  • The t6030-j514s.dtb embedded in m1n1's stage 2 is the package's dtb, byte for byte.

On that kernel:

  • 7 cpu-*-thermal zones, each with one trip, critical at 110000. Both CPU cooling devices (cpufreq-cpu0, 20 states; cpufreq-cpu1, 8 states) stay at state 0.
  • "EM: created perf domain" for cpu0 and cpu1, and sched_energy_aware reads 1.
  • macsmc_soc_die: "hottest of Te05 Te0P Tp0U Tp0a Tp1I Tp1Q Tp0g Tf24 Tf28 Tf29 Tf2E (11 of 11 listed keys present)".
  • No thermal warnings in the boot log.
  • Critical trip: writing 110000 to cpu-p0-thermal's emul_temp gave "cpu-p0-thermal: critical temperature reached" then "reboot: HARDWARE PROTECTION shutdown (Temperature too high)", followed by an orderly systemd shutdown.

Load tests, 10 min each, no throttling by Linux (the behaviour patch 3 keeps). The earlier test zones had trips at 85/100 °C and never acted in these runs:

load hottest core sensor, last 5 min P cluster fans heatpipe power (PHPC)
5 P cores 93.5 °C mean, 98.1 °C peak 4056 MHz steady ~4500-5000 rpm 21.6 W
all 11 cores 93.6 °C mean, 97.8 °C peak 4056 MHz steady ~5200-6000 rpm 26.3 W
5 P cores + GPU (glmark2 terrain) 97.4 °C mean, 97.8 °C peak 4056 MHz steady ~6000-6500 rpm (max) 33.7 W

Energy-aware scheduling (patch 1), as an A/B with sched_energy_aware on and off, alternated twice. The load was 4 processes, each doing a fixed amount of work every 100 ms:

  • EAS on: 11.5-11.9 W system power; 77-84% of the CPU time on E cores.
  • EAS off: 12.1-12.3 W; 27-46% of the CPU time on E cores.
  • Unchanged: per-period work time (36-38 ms mean, 41-45 ms p95), no missed periods, and idle power within noise (9.7-10.1 W).

macOS on a second J514S (same model), for reference. The same busy loops ran 10 min with SMC keys read through AppleSMC and powermetrics:

  • With all 11 threads busy, macOS held the CPU at about 11 W, with P cores about 52% active at about 2.9 GHz.
  • The core sensors averaged 81-83 °C, the fans ran at about 2500-3500 rpm, and the thermal pressure stayed "Nominal" throughout.

So macOS trades clock for quieter fans by policy, not thermally. I did not try to copy that in the device tree. This PR leaves the CPUs at full clock under the fan curve.

Build:

  • make W=1 apple/t6030-j514s.dtb: the same 9 warning kinds as without the series, none new.
  • make W=1 drivers/hwmon/macsmc-hwmon.o (clang): clean.
  • checkpatch.pl on the commits: clean apart from the trailers and the mainline commit id it cannot see in a shallow clone.

What was NOT tested

  • Failed or blocked fans. I cannot stop the fans (fan_control is N), so it is untested whether the SMC/SoC throttle the CPUs before 110 °C when the fans can't cope. The critical trip is the Linux-side backstop for that case.
  • Other machines:
    • The 12-core M3 Pro: cpu@10105 and its die key are not covered.
    • The J516S (16") is not covered. Its existing hwmon entry lists Tf04, Tf09, Tf0D, Tf2A, Tf2B, none of which exist on this M3 Pro (verified on two J514S). I left it alone because I have no J516S to check it on.
  • GPU: m3_thermal_policy.rs names the J514S and J516S and needs both macsmc_soc_die and apple_pmp_hotspot. Nothing registers apple_pmp_hotspot yet, so nothing changes for the GPU today. Once it does, the zone's hottest key includes the CPU-core keys (93-98 °C under CPU load), so the GPU would be held at its safe cap during heavy CPU load: conservative, not unsafe.
  • Per-core labels on other parts: the "P-core N" labels were matched to keys on an 11-core J514S. Which core each key belongs to on the J516S and the 12-core part is unverified (labels only).
  • Battery life over a full day with EAS on: not measured beyond the A/B above.

Risk

  • J516S (16" M3 Pro): patches 1 and 2 change it too, through t6030.dtsi. It gains the energy model (so EAS turns on), the cooling and thermal-sensor cells and the Te/Tp sensor nodes, but no thermal zones, so there is no early-shutdown risk. hwmon switches to indexed mode and renumbers its temperature channels (temp1 is now Te05); nothing in our packages reads them by number. Not booted on a J516S; a boot from anyone who has one would be welcome.
  • Other Macs: no change. Patches 3 and 4 match only apple,j514s.
  • J514S:
    • EAS now places light work on the E cores, which saved about 4% power in the test above with no latency change.
    • The thermal zones only act at 110 °C, which no load reached; the peak was 98.7 °C.
    • The 12-core part also uses t6030.dtsi. Patch 2 gives its cpu@10105 #cooling-cells like the others, and patch 1 gives it the same OPP power. No zone names cpu@10105.

AI assistance

  • I used an AI tool or agent to write or draft part of this change: Claude (claude-opus-5-5), via Claude Code. It did the measurements, the patches and this text, with me running the machines and reviewing.
  • A human has read the whole diff and takes responsibility for it.

🤖 Generated with Claude Code

ilyasakin and others added 4 commits November 15, 2026 12:27
T6030's OPP tables have no opp-microwatt, so its CPUs have no energy
model: the scheduler cannot place tasks by energy, and the power
allocator thermal governor would have no power actors.

Add per-CPU power for every OPP of both clusters, measured on a J514S
(MacBook Pro 14", 11-core M3 Pro) through the SMC's cluster power keys
(PPMC, PP0C): the cluster pinned to the state, all of its CPUs busy
minus the cluster idle, divided by the number of CPUs, each state
started cool. The values are fitted curves so that they rise
monotonically.

From 3576 MHz up the P cluster's power stays at about 19.5 W with all
five CPUs busy, and the E cluster's 2748 MHz state draws what 2640 MHz
does: the hardware limits the top states itself. Those states get the
extrapolated curve.

With the energy model, energy-aware scheduling is enabled on these
machines (sched_energy_aware reads 1 with schedutil).

Assisted-by: Claude:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Ilyas Akin <ashnwor@gmail.com>
…ensors

Make the CPUs cooling devices (apple-soc-cpufreq registers them when
the CPU nodes have #cooling-cells), as on t8122, and add seven SMC die
temperature sensors as the first temperature channels of the SMC hwmon,
so that board thermal zones can refer to them by index.

The keys were picked on a J514S (MacBook Pro 14", 11-core M3 Pro) from
the SMC key list by loading one CPU at a time: for each P core the key
that rose most with only that core busy (Tp0U, Tp0a, Tp1I, Tp1Q, Tp0g
for cpu@10100..10104, about 25 C, 10-15 C more than with any other core
busy), and Te05 and Te0P, the two keys that rose most with the whole E
cluster busy (single E cores barely warm any sensor). cpu@10105 is
absent on the 11-core part, so its key is not identified.

Assisted-by: Claude:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Ilyas Akin <ashnwor@gmail.com>
Linux has no thermal zone on the J514S, so nothing shuts it down if
its cooling fails.

The SMC runs the fans and needs no help from Linux: in ten-minute load
tests (five P cores, all eleven cores, five P cores plus the GPU) the
fans held the hottest core sensor at 93-98 C at full clock, at up to
about 6000 rpm. A power allocator zone throttling below that, like the
fanless J613's, fought the fan curve: the fans stayed near 2300 rpm and
the P cluster swung between 696 MHz and 4.06 GHz, averaging 3.1 GHz.

So, as the Qualcomm X1E laptops do since commit 06eadce ("arm64:
dts: qcom: x1e80100: Drop unused passive thermal trip points for CPU"),
add one zone per CPU die sensor with only a critical trip, at 110 C as
on the J613, for an orderly shutdown if the platform's own cooling
fails.

Assisted-by: Claude:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Ilyas Akin <ashnwor@gmail.com>
The J514S has no entry in the board table, so it has no SoC die
temperature zone. Give it its die keys: the CPU die keys of the board's
device tree (Te05, Te0P, and Tp0U, Tp0a, Tp1I, Tp1Q, Tp0g, one per P
core) and the four Tf2x keys that rose 11-14 C with only the GPU busy
and about 1 C with all P cores busy. The GPU's own Tg keys read 0 C or
slightly below on this machine even while it renders, so they are not
used. Also expose the thermal pressure level (mTPL), which the J514S's
SMC has.

Assisted-by: Claude:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Ilyas Akin <ashnwor@gmail.com>

@scottjones scottjones left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, and for the clear J514S evidence: the energy-model domains, all 11 die keys and the emulated-temperature shutdown at the 110 C trip. The code looks right to me, so I'm approving. A few notes for the PR text and a follow-up:

  • Other Macs do change. Everything in patches 1 and 2 lands in t6030.dtsi, which the J516S (16" M3 Pro) also includes. The J516S gains the energy model (so EAS turns on), the cooling and thermal-sensor cells and the Te/Tp sensor nodes, but no thermal zones, so there's no early-shutdown risk. hwmon also switches to indexed mode and renumbers the temp channels there (temp1 is now Te05). Nothing in our packages reads those channels by number, so it's cosmetic. Shared placement is right: it's the same pattern #146 used in t8122.dtsi. Please correct the "other Macs unchanged" line, and a J516S boot would be welcome if anyone has one.
  • The GPU driver does read the new die zone on T6030. m3_thermal_policy.rs names the J514S and J516S and needs both macsmc_soc_die and apple_pmp_hotspot. Nothing registers apple_pmp_hotspot yet, so nothing changes today. Once it does, the CPU-core keys (93-98 C under CPU load) would hold the GPU at its safe cap. That's conservative, not unsafe, but worth stating as a choice.
  • Labels: the "P-core N" labels were matched to keys on an 11-core J514S. On the J516S and 12-core parts, which core each key belongs to is unverified. It's labels only.
  • Question, not a blocker: the T6030 E-core power figures come out 2.4-2.8x T8122's for the same core (P-cores 1.2-1.3x), measured through a different SMC key. Was PPMC checked against powermetrics?

@ilyasakin

Copy link
Copy Markdown
Author

Thanks for the review. I've updated the PR text to match:

  • J516S: the "other Macs unchanged" line is now an explicit J516S entry: energy model/EAS, the cells and the sensor nodes, the hwmon renumbering, no zones. I have no J516S to boot.
  • GPU: added the m3_thermal_policy.rs / apple_pmp_hotspot note. When apple_pmp_hotspot is registered, the zone's hottest key will include the CPU-core keys, so a CPU-heavy load would hold the GPU at its safe cap. I've stated that as a choice.
  • Labels: noted that the per-core labels are only matched on the 11-core J514S.

PPMC vs powermetrics. powermetrics on macOS 27.2 no longer reports per-cluster power, only the CPU total. So I checked that the SMC cluster keys add up to it. On a second J514S running macOS, six background-QoS loops (so E cores only) gave:

  • powermetrics: CPU Power 7.62 W;
  • SMC, same 16 s window: PPMC + PP0C 8.20 W (PPMC 2.22 W; the P cluster was busy with other apps at the time).

They agree within about 8%, so PPMC doesn't look inflated. The per-CPU E figures come from PPMC with all six E cores busy, minus the cluster's idle power, divided by six, and each state was started cool. I can't explain the 2.4–2.8× against T8122 from this alone. A different E-core voltage table on T6030 would do it, but I haven't verified that. If you'd rather I take the E-cluster numbers from a direct powermetrics-style measurement, I can redo the fit.

@scottjones

Copy link
Copy Markdown
Collaborator

A follow-up question from reviewing #488: does Tf2E read differently from Tf24 under GPU load? It matters more here, since this die list feeds the M3 GPU thermal cap, and one unreadable key fails the whole zone read.

@ilyasakin

ilyasakin commented Nov 16, 2026 •

Copy link
Copy Markdown
Author

Measured on the J514S. All four Tf2x keys move together under a full GPU load, and Tf2E stays within 0.2 C of Tf24. The numbers are in #488 (comment). Tf2E read without error on every sample, so it doesn't add a zone-read failure I've seen. I'd keep it in die_keys, but I can drop it if you'd rather keep the list minimal.

@c4software

Copy link
Copy Markdown

Tested on a second J514S.

  • sched_energy_aware=1, with schedutil on both policies.
  • 7 thermal zones (cpu-e0/e1, cpu-p0..p4), each with a 110 °C critical trip. At idle: E cores 46 °C, P cores 44 °C.
  • The die keys show up in hwmon as SoC die Te05/Te0P/Tp0U/Tp0a/Tp1I/Tp1Q/Tp0g/Tf24/Tf28/Tf29/Tf2E. All read without error.
  • Not tested: behaviour under sustained load and near the trip point.
Test setup

Testing and write-up assisted by Claude Code.

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