Skip to content

arm64: dts: apple: t604x-j614-j616: leave fast thermal control to the PMP, critical at the ADT limit - #907

Merged
RyanTheTide merged 2 commits into
integration/aurorafrom
thermal/j616s-control-margin
Nov 3, 2026
Merged

RyanTheTide merged 2 commits into
integration/aurorafrom
thermal/j616s-control-margin

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

On the J616s (M4 Pro MacBook Pro 16), a sustained mixed load powered the machine off after 16 minutes. The load was stress-ng (7 cpu, 2 vm, 2 matrix, io), a glmark2 loop and an ANE MobileNet loop. One cpu-p15-thermal sample hit the 118 C critical trip and triggered the HARDWARE PROTECTION shutdown. This PR changes only the device tree.

Why it happened

The CPU zones read the SMC per-core die maxima (Tpx/Tex) and TCMz. These follow a core's power within a second.

  • Under that mixed load they move 9-10 C (one SD) between the 1 s samples the zones see. Under an all-core build it's 1.1 C.
  • The PMP's fast die-temperature loop regulates its own sensors at the ADT target of 110 C, and cpufreq already enforces its effort. It holds the build at TCMz 113-114 C. During the mixed-load spikes its effort stays at 0.
  • I emulated lower control trips through sysfs. Every one still reached a 116.5 C guard within 30-150 s: 110, 105 and 100 C, an integral-led variant, and a variant with all clusters mapped to every zone. At 100 C the clusters were held at 1.26 GHz and a P1 core still read 116.5 C.
  • No control point that a 1 Hz controller can hold stops single excursions to 118 C.
  • The 118 C trip was chosen by Linux. The ADT temp-sensor table gives every PMP sensor a 110 C target and a 125 C maximum (the sochot level).

Changes

  1. Drop the unused fan ladder. The macros and the deletion pass described trips that the compiled device tree never contains. The j616s and j614s DTBs are byte-identical before and after.
  2. Leave fast control to the PMP, on all 17 CPU zones:
    • The PMP's loop keeps the fast control, as on macOS.
    • Critical trips move to 125 C. A 120 C hot trip only reports.
    • The control trip moves to 115 C, above the PMP's operating point, so the power allocator only trims what the PMP lets through.
    • Switch-on moves to 75 C, and integral-time-constant-ms = 20000 is added. Together they lower the proportional gains to 40% and make the zones integral-led.
    • Each zone keeps throttling only its own cluster. A variant that mapped all clusters to every zone left a hot P1 core's cluster at 3.1-3.9 GHz.
    • The GPU zones and the fans are unchanged. The fans stay with the SMC, as on macOS, which makes no SMC writes.

Hardware results (J616s, fleet15, Stage 2 ec7e1217 with only the DTB swapped, one-shot aura-try)

before (stock DT) after (this PR)
30-min combined load shutdown at 16 min (fleet14p) PASS, 1800 s, no hot/critical event
TCMz under combined load reached 118 mean 111.5, p99 116.8, max 117.4 C; 0 samples at or above 120
fans under combined load SMC policy 3380/3650 rpm (SMC policy)
glmark2 under combined load - median 6539 (60 runs)
ANE MobileNet p50 under combined load - median 0.574 ms, 88/88 PASS
coremark-10, 10 P cores (first / median of last 5) 436.7k / 447.9k; 449.1k / 449.9k 448.3k / 445.9k
defconfig Image+modules -j14 218.5 s; 219.8 s 220.9 / 220.3 / 220.5 s (3 back to back)
build peak, any CPU zone 115.5 C 115.3 C
s2idle x2, kernel -p3, SELinux - 2/2, -p3 0, Enforcing
  • CPU-only cost is within about 1%: builds +0.2-1.1%, coremark sustained -0.4 to -0.9%. That's the same size as the run-to-run spread of the two stock baselines.
  • The one AVC on the trial boot (systemd getattr on a netlink_kobject_uevent_socket) appears on every stock boot too.
  • Not covered by this PR: under combined load the E cluster sits at its lowest state, both with this change and with the stock trips.

Follow-up

A critical-samples thermal_of property: a critical trip acts only after N consecutive samples, with KUnit coverage. It is ready on thermal/critical-samples and comes as the next PR.

Evidence (per-second logs, scripts, ADT decode): aurora-ctl reports/thermal-j616s-20261103.

🤖 Generated with Claude Code

Commit 03ce684 ("arm64: dts: apple: Use firmware fan policy and
expose thermal pressure") left the fans to the SMC, as macOS does, and
52cbd7f404cd deleted the remaining ladder instances at the end of the
file so that branches still adding them would land cleanly. Those
branches have landed, so the ladder macros, their call sites and the
deletion pass only describe trips the device tree never contains.

Remove all three and say in the zones' comment that the fans stay with
the SMC. The compiled t6040-j616s and t6040-j614s device trees do not
change.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
A sustained mixed load on the J616s (stress-ng cpu, vm, matrix and io,
a glmark2 loop and an ANE loop) powered the machine off after 16
minutes: one cpu-p15-thermal sample reached the 118 C critical trip.

The CPU zones' sensors are the SMC per-core die maxima (Tpx*, Tex*) and
TCMz, their maximum. They follow a core's power within a second, and
under that load they move by 9-10 C (one standard deviation) between
the 1 s samples the zones see. The PMP's fast die-temperature loop,
which cpufreq already enforces, regulates its own hot-spot sensors at
the ADT target of 110 C and does not see these excursions: its effort
stayed at zero while Tpx read 116 C. With the power allocator emulated
at a 100, 105 or 110 C control point, single samples still reached
116.5-117 C within 30-150 s, with the clusters held as low as 1.26 GHz.
No control point a 1 Hz controller can hold stops single excursions to
118 C, and the proportional gains made the allocator swing between no
limit and full cooling every second.

The 118 C trip was chosen by Linux, not Apple. The ADT temp-sensor table
gives every PMP sensor a 110 C target and a 125 C maximum, the sochot
level, and the SMC sensors read a few degrees above the PMP's. So:

- Critical trips move to 125 C on the 17 CPU zones, with a 120 C hot
  trip that only reports.
- The control trip moves from 116 to 115 C, above the PMP's operating
  point (TCMz 113-114 C under an all-core build), so the PMP keeps the
  fast control as on macOS and the allocator only trims what it lets
  through.
- Switch-on moves from 100 to 75 C. The 40 C window lowers the
  proportional gains to 40%, and integral-time-constant-ms = 20000
  sets an integral term of k_pu / 20 per second, so the zones act on
  the average rather than on single samples.
- Each zone keeps throttling only its own cluster: a variant that
  mapped all three clusters to every zone left a hot P1 core at
  3.1-3.9 GHz while P0 dropped to 1.26 GHz, because the allocator
  divides a zone's budget by requested power.

The GPU zones and the fans are unchanged; the fans stay with the SMC,
as on macOS.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
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.

1 participant