Repository navigation
Conversation
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
left a comment
There was a problem hiding this comment.
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 (temp1is 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 int8122.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.rsnames the J514S and J516S and needs bothmacsmc_soc_dieandapple_pmp_hotspot. Nothing registersapple_pmp_hotspotyet, 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?
|
Thanks for the review. I've updated the PR text to match:
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:
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. |
|
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. |
|
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 |
|
Tested on a second J514S.
Test setup
Testing and write-up assisted by Claude Code. |
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.
opp-microwattfor 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).#cooling-cellson the CPUs, as on t8122, and seven SMC die sensors as the first hwmon temperature channels: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_allocatorzone 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:Two more problems with this approach:
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:
0b16569a9was built with the omarchy-pkgslinux-aurorarecipe (omarchy-pkgsfb18a8a), pointed at the commit withtools/aurora-ci/prepare-recipe.py, as7.2.11.aurora16-1.1.omarchy-apple-silicon-boot-check --boot-chainpasses.t6030-j514s.dtbembedded in m1n1's stage 2 is the package's dtb, byte for byte.On that kernel:
cpu-*-thermalzones, each with one trip,criticalat 110000. Both CPU cooling devices (cpufreq-cpu0, 20 states;cpufreq-cpu1, 8 states) stay at state 0.sched_energy_awarereads 1.macsmc_soc_die: "hottest of Te05 Te0P Tp0U Tp0a Tp1I Tp1Q Tp0g Tf24 Tf28 Tf29 Tf2E (11 of 11 listed keys present)".cpu-p0-thermal'semul_tempgave "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:
Energy-aware scheduling (patch 1), as an A/B with
sched_energy_awareon and off, alternated twice. The load was 4 processes, each doing a fixed amount of work every 100 ms:macOS on a second J514S (same model), for reference. The same busy loops ran 10 min with SMC keys read through AppleSMC and
powermetrics: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.plon the commits: clean apart from the trailers and the mainline commit id it cannot see in a shallow clone.What was NOT tested
fan_controlis 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.m3_thermal_policy.rsnames the J514S and J516S and needs bothmacsmc_soc_dieandapple_pmp_hotspot. Nothing registersapple_pmp_hotspotyet, 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.Risk
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 (temp1is 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.apple,j514s.t6030.dtsi. Patch 2 gives its cpu@10105#cooling-cellslike the others, and patch 1 gives it the same OPP power. No zone names cpu@10105.AI assistance
🤖 Generated with Claude Code