Repository navigation
t8132: enforce the PMP's fast-die effort, as macOS's CLPC does - #2646
DjDeveloperr wants to merge 3 commits into
Conversation
|
The read side looks right. Entry 465 at Two points:
Assisted-by: LLM (Claude:Opus 5.5) |
2c915cc to
d94dab9
Compare
|
Follow-up note: the IRQ-started variant (macOS starts its FAST-DIE-CE reads from the PTD entry interrupt) is left for a later change. The boot-time writes macOS makes to the PTD interrupt registers are known from a hypervisor trace (enable-set at +0x18238 bit 17 for this entry, vector select at +0x184e8/+0x184ec). The AIC line the vector raises still needs a trace with interrupt logging, so until then this uses the sampled path already merged for T6041/T8140/T6050. 🤖 Generated with Claude Code |
|
Row on an M4 MacBook Air (J713, fanless, macOS 27.2 firmware, AC). The same lab kernel was run with this series (both commits) and without it. The J713 ADT lists FAST-DIE-CE (id 0x1f) at PTD entry 465, count 2, as on the mini. Load: 10 busy threads for 150 s after 60 s idle, sampling every 5 s.
On this machine the series makes no measurable difference under this load. In both runs the caps (P down to 3.1 GHz, then to 0.9-1.8 GHz) come with Assisted-by: LLM (Claude:Opus 5.5) |
The T8132 PMP runs a fast die-temperature control loop for each CPU cluster and the ANE (the PMP node's fast-die-ctrl-loop, with a 100 C average sensor target and a 5 ms period) and publishes its effort in the PTD entry the PMP node's ptd-range table names FAST-DIE-CE: entry 465, two lanes. The table also places the entries this driver already uses on T8132, PMP-STATUS at entry 1 and the soc-device request and acknowledgment at entries 392 and 400. Its fast-die-ctrl-ce-map puts the EACC loop on lane 0 and the PACC and ANE loops on lane 1, as on T8140, and the clpc node's ptd-ranges include FAST-DIE-CE. A boot trace of macOS 27.2 under the hypervisor shows it reading FAST-DIE-CE as one 128-bit access, and no PTD word 32 bits wide. Read the effort as the low half of the entry's first 64-bit word on T8132; the other SoCs keep their 32-bit read. Describe the entry, so apple,fast-die-effort can point cpufreq at it. Signed-off-by: Diljit Singh <[email protected]>
The T8132 PMP runs a fast die-temperature loop per CPU cluster and publishes an effort for each. On Linux the T8132 cpufreq nodes do not point at the effort, so only the provisional apple-pmp-thermal limits apply. Point both clusters at their lanes of the effort, E on lane 0 and P on lane 1, as on T8140. apple-soc-cpufreq then enforces it as a maximum frequency QoS limit with its (255 - effort) / 255 mapping, and holds the fallback limit until the PMP runs. On the Mac mini (J773g) the loop engages only on short peaks: under a sustained all-core load the P lane's effort was non-zero for 5-55 ms at a time, at PMP sensor peaks of about 110 C, and zero otherwise. The limit acts at those peaks; it does not change the sustained temperature, which follows the load. Native macOS leaves the fan in the SMC's automatic mode on this machine, and the fan follows the SMC's own policy on both systems. Signed-off-by: Diljit Singh <[email protected]>
d94dab9 to
d1c81d6
Compare
|
J773g (M4 Mac mini, macOS 27.2 firmware 26B123) row for this PR
Assisted-by: LLM (Claude:Opus 5.5) |
|
No blockers. The read side is right: entry 465 at 0x1d10 is 8-byte aligned, readq() takes its first word, both lanes are in the low bytes, and the other SoCs keep their 32-bit read.
|
|
J713 suspend row at d1c81d6, run on the J713 default kernel (7.3.0-bj713t6+, which carries this head; default cmdline; 27.2), on a fanless M4 Air. Test: one 15 s deep sleep woken by the PMU RTC.
The same kernel also passed 13 deep sleeps and warm reboots ×3 with full caps in the J713 default gate. Still to run: the fanless row where a non-zero effort turns into a cap and then lifts. Assisted-by: LLM (Claude:Opus 5.5) |
Signed-off-by: Dj <[email protected]>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
There was a problem hiding this comment.
Verdict: FINISH, then merge at 9e9006b3
Blockers:
drivers/pmdomain/apple/pmp-report.c:89: addsbool fast_die_wide;tostruct apple_pmp_report_offsets, which already hasbool fast_die_wide;onmain(line 92), causingkunitCI to fail compilation witherror: duplicate member 'fast_die_wide'. Rebase/drop the duplicate struct field and re-run CI.- Address the earlier non-blocking notes (document how the cpufreq fallback limit compares with
max_unmanaged_pstateand ensure an exact-head row once rebased).
Checked:
arch/arm64/boot/dts/apple/t8132.dtsi:35-44andDocumentation/devicetree/bindings/cpufreq/apple,cluster-cpufreq.yaml:9-15: lane 0 (EACC) and lane 1 (PACC) wiring and binding text matchapple_pmp_offsets_t8132(fast_die = 0x1d10,fast_die_lanes = 2,fast_die_wide = true).- Confirmed
aurora/mainalready carriesbool fast_die_wideindrivers/pmdomain/apple/pmp-report.c:92.
Evidence
kunitCI log (run45741656886):../drivers/pmdomain/apple/pmp-report.c:93:7: error: duplicate member 'fast_die_wide'.git grep -n fast_die_wide aurora/main -- drivers/pmdomain/apple/pmp-report.c: line 92 already definesbool fast_die_wide;.
Summary
The T8132 PMP runs a fast die-temperature loop for each CPU cluster and publishes an effort per cluster in its PTD. On T6041, T8140 and T6050 Linux already enforces that effort through apple-soc-cpufreq. On T8132 it does not, so the only limits are the provisional apple-pmp-thermal ones. This series wires T8132 up the same way:
0x1d10), with two lanes: 0 = EACC, 1 = PACC+ANE. The effort is read as a 64-bit word (fast_die_wide), the only width macOS uses in the boot trace below. The other SoCs keep their 32-bit read.apple,fast-die-effort = <&pmp_report 0>on the E cluster and<&pmp_report 1>on the P cluster, plus the lane text in the binding. apple-soc-cpufreq's existing sampled path applies it as a maximum-frequency QoS limit with its existing (255 - effort) / 255 mapping.This started from "the Mac mini's fan doesn't respond to load on Linux". The fan side needs no change: the fan follows the SMC's own policy on both systems. See below.
Evidence
Apple device tree (J773g, 27.2)
fast-die-ctrl-looprecords for EACC, PACC and ANE, each with a 110.0 C value, plusfast-die-ctrl-ts-avg-temp100.0 andfast-die-ctrl-ts5 ms.ptd-rangetable names FAST-DIE-CE id 0x1f at entry 465, count 2. The same table has the entries pmp-report already uses on T8132: PMP-STATUS 1, SOC-DEV-PS-REQ 392, SOC-DEV-PS-ACK 400.fast-die-ctrl-ce-mapputs EACC on lane 0 and PACC with ANE on lane 1.clpcnode'sptd-rangesinclude FAST-DIE-CE.Hypervisor trace (macOS 27.2 boot)
0x1d10as one 128-bit access, never0x1d20, and makes no 32-bit PTD read.macOS and the fan
F0Md0) and keeps it at its 1000 rpm minimum through 150 s of all-core CPU load and 150 s of Metal compute load, because its die stays at about 80 C.Test on the Mac mini
A test module read the same words as the trace (64-bit, read only: PMP-STATUS, FAST-DIE-CE value and stamp) every 5 ms. In a second run it also applied this series' mapping as cpufreq QoS. Both runs used the same load profile as the macOS reference. No errors, stalls or warnings.
Status
pmp-floor-tests --mutant class-twice, doesn't build with the host's newer gcc (-Wunused-but-set-variable) and passes with that warning off. This change doesn't touch it.