Repository navigation
arm64: dts: apple: t8142: CPU idle, PMU and cluster power gate on every M5 (on #2325) - #2328
RyanTheTide wants to merge 4 commits into
Conversation
…ry M5 The CPU cluster power-gate enables, the CPU PMU and the PSCI retention idle state are CPU/PMGR facts of the T8142, not of a board: the J704, J813 and J815 ADTs have the same /cpus and the same pmgr. They were only described for the MacBook Airs (cluster_pwrgate in t8142-j813.dts alone, cpu_pmu enabled per board, the idle states in the Air-only t8142-j813-psci-idle.dtsi), so on the MacBook Pro 14" (J704) the boot P core never powered down in WFI, perf had no hardware counters and cpuidle-psci had no state under aura's PSCI monitor. Move cluster_pwrgate into t8142.dtsi (as t8140.dtsi already has it), enable cpu_pmu there, and rename t8142-j813-psci-idle.dtsi to t8142-psci-idle.dtsi, included from t8142.dtsi. Without a /psci node cpuidle-psci does not probe, as before. J813: unchanged. J815: gains cluster_pwrgate. J704: gains cluster_pwrgate, the PMU and the retention idle state. cluster_pwrgate is gig3m's (c58ab8c). Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
No row has covered this one yet. gig3m's J813 row on #2325 ran with this PR on top, but this change leaves the J813 tree unchanged, so that row only shows it doesn't break the J813 (including two deep sleeps). term-guy's J704 rows on #2325 and #2329 were on a kernel without it. Still open, as listed above:
|
|
J815 (MacBook Air 15" M5) row for the boot-core cpuidle residency. Kernel: integration/aurora Before and after. On the J815 this PR does not change the device tree: the J815 DTB with it is identical, node for node, to our previous J815 DTB without it, apart from phandle numbers. (In the old tree Residency. 30 s with the desktop idle, deltas of
On T8142, index 1 is the second WFI entry by design (the driver keeps index 1 for the s2idle path, and CYC_OVRD is locked from M4 on), so it is named |
|
J704 (MacBook Pro 14" M5) row. macOS 27.2 (26B123) stub. Kernel: this head No PSCI monitor here. The installed aura starts the CPUs with spin-table (secondaries confined at EL2), so there is no cpuidle. 30 s with the desktop idle, deltas of
Every CPU climbs. PMU. Before this PR the J704 had no hardware counters ( Cluster power gate. The driver ran at boot ( Read back through /dev/mem: both words are 0x80000000. On the kernel without this PR, the P word (+0x60, the boot core's) is 0x00000000, as the description says. s2idle.
Deep sleep stays off: no sleep controller node on the J704 yet. Unrelated to this PR, seen in the same boots: with #2325's AVE enabled, the J704 on 27.2 logs AI-assisted, tested by me on the hardware. |
Via the updated dtfill/t8142-media-default (#2325). No textual conflicts; t8142-j813-j815.dtsi: dropped the cluster_pwrgate copy integration added there (now in t8142.dtsi), t8142-j813-j815-sleep.dtsi comment points at t8142.dtsi. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Merged integration/aurora (d1b022d, via the updated #2325 branch); no textual conflicts, dropped the duplicate cluster_pwrgate integration added to t8142-j813-j815.dtsi (now in t8142.dtsi); t8142-j704/j813/j815 dtbs and cpuidle-apple.o build (J813/J815 differ from #2325 only by the implicit pmu status=okay). |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal pre-PR review of 7549efa949b3f1e1761fd93ed12a750fe4fd8511 (incremental diff over #2325 427ad2c57bc0 and full diff against main).
The hardware design of the incremental change is sound: cluster_pwrgate (reg PMGR +0x0 / +0x60), cpu_pmu (apple,t8142-pmu), and t8142-psci-idle.dtsi are T8142 SoC-level facts shared across J704, J813, and J815. apple-cluster-pwrgate.c maps the two words unclaimed via of_iomap() (no conflict with dcp_power or peripheral_clocks), all references to t8142-j813-psci-idle.dtsi are updated (t8142-j813-j815.dtsi and drivers/cpuidle/cpuidle-apple.c), and cpuidle-psci remains safely inactive unless /psci is present.
Blocking items
- Merge conflict against
main(CONFLICTING/DIRTY) and stacking:arch/arm64/boot/dts/apple/t8142-j813-j815.dtsiconflicts at EOF with#1905(4ac9958640, SIO AES enables) via#2325. Because this PR targetsmainwhile stacked on#2325, please restack/update cleanly once#2325resolves itsmainconflict (preserving&ps_sio,&ps_aes,&sio_dart,&aes) and re-verifydt-checksandhost-tests. - Misplaced
cluster_pwrgatenode detachesmcc's doc comment inarch/arm64/boot/dts/apple/t8142.dtsi:cluster_pwrgate: power-gate@380724000and its block comment are inserted directly betweenmcc's block comment (/* System level cache planes: ... */) andmcc: memory-controller@220000000. Please placecluster_pwrgateeither beforemcc's comment or in its own position (e.g. afterpmgr, matchingt8140.dtsi) somcc's comment stays attached tomcc. - §5 hardware evidence gaps on the updated head:
- All hardware rows (
@m0d16l14n1J815,@term-guyJ704,@gig3mJ813) ran on pre-merge95dda1cb24ebrather than the current head7549efa949b3(and will need refreshing after the rebase ontomain), and none report the §5 regression counters (0 SELinux denials, 0 failed units, 0 new kernel errors). - On J704 (the only board newly gaining
t8142-psci-idle.dtsi), the test booted under spin-table (apple_idle, no/pscinode), socpuidle-psciwas not exercised on J704. If J704 does not yet have a PSCI monitor build to test against, please state that explicitly as a known limitation alongside the J704apple_idleverification. @term-guy's J704 s2idle testing observed 1 hang + ~3.5 min reset out of 6 entries (unattributed, not reproduced on repeat). Becausecluster_pwrgatedirectly enables boot P-core power gating in WFI/s2idle, please confirm clean multi-cycle s2idle repeatability on the rebased head (or confirm that failure is unrelated).
- All hardware rows (
Checklist summary (§1–§6)
- §1 No model gating: Pass — moves
cluster_pwrgate,cpu_pmu, and PSCI idle states into sharedt8142.dtsi/t8142-psci-idle.dtsi. - §2 Production-ready: Pass — standard DT nodes, no cmdline parameters or workarounds.
- §3 Safety / hardware correctness: Pass on DT/driver register definitions and
of_iomapsharing; s2idle stability tracking noted under §5 above. - §4 Clean-room and attribution: Pass — all 4 commits carry human author/committer and
Signed-off-by:only, with no AI trailers in commits. - §5 Evidence: Incomplete — exact-head CI on
7549efa949b3is green (dt-checksandhost-testspass), but hardware rows predate the merge, omit §5 regression counters, did not exercisecpuidle-pscion J704, and include an unresolved 1/6 J704 s2idle hang. - §6 Naming: Pass.
Minor doc nit (non-blocking): the PR description and commit 95dda1cb24eb still state that cluster_pwrgate existed only in t8142-j813.dts and that J815 gains it, whereas #1806 already moved cluster_pwrgate into t8142-j813-j815.dtsi on main (so only J704 gains it now).
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: FINISH, then merge at 7549efa949b3
Blockers:
- A hang was seen with this change: term-guy's J704 s2idle testing hung once in 6 entries (then reset after about 3.5 min), and it wasn't reproduced or explained.
cluster_pwrgateturns on P-core cluster power gating in WFI/s2idle on the J704, so this is the first suspect. Fix: a multi-cycle s2idle run on the J704 at the updated head (at least 10 entries) that comes back clean every time, or the same hang rate withoutcluster_pwrgate, showing it's unrelated. - The branch conflicts with
mainthrough #2325 (the SIO AES block from #1905 at the end oft8142-j813-j815.dtsi). It merges after #2325, once that's updated.
Checked: no Apple material, no board gates: cluster_pwrgate, cpu_pmu and t8142-psci-idle.dtsi are T8142 SoC-level facts. apple-cluster-pwrgate.c maps its two words without claiming them, cpuidle-psci stays off without /psci, and the renamed include is updated everywhere. dt-checks and host-tests green. This replaces my earlier review. Nit: cluster_pwrgate sits between mcc's comment and mcc in t8142.dtsi; move it after pmgr, as in t8140.dtsi. J704 booted under spin-table (apple_idle), so cpuidle-psci itself is untested there; say so in the body.
Evidence
Read 7549efa9 (incremental over #2325) and term-guy's J704 notes.
Superseded by the review at 7549efa
|
Can we merge it? |
|
J813 (MacBook Air 13" M5) row at
Assisted-by: LLM (Claude:Opus 5.5) |
|
J704 (MacBook Pro 14" M5) s2idle row at Kernel: this head merged into Power gate on: both words read back Run: 12 entries, 20 s apart, each woken by a key press. 11 woke 2-17 s after entry; the 8th 2 min 14 s after, because the key was pressed late. 12 entries and 12 exits in the journal, no aborts. The USB gadget was unbound for the run, because its suspend refuses s2idle ( On the first entry, as on every run on 11-20:
Remaining kernel err lines: all known ( Against 11-20: 1 hang in 6 entries then, 0 in 12 now. The 11-20 hang (#1156) stays unexplained and wasn't reproduced either time. This run is at the current head; once the branch is updated after #2325 I can repeat it. |
|
Picking this up for FIXUP-A (its lane ended). Blocker 1 needs a J704. There's no M5 in our lab, so @term-guy, could you run at least 10 s2idle entries on the J704 at this head once it's updated after #2325, or the same count without |
|
@RyanTheTide thanks for picking this up. #2325 is already in: it merged on 11-24 ( The J704 run at the current head is in #2328 (comment): 12 of 12 s2idle entries entered and woke on a key, with |
|
J704 s2idle at Setup for #1232-#1234: test kernel
The #1232 hang: entry 10 at 288 s of uptime logged On every boot, with and without the gate: the PMP firmware crashes once, on the first entry only (as on 11-20 and in #1227); Once the forward merge is pushed I'll run the same count at the new head. |
|
Status at Thanks for the runs. With
Separately, the forward merge with |
It sat between mcc's comment and mcc. Place it after pmgr in the /soc block, as t8140.dtsi does. The node path and every property stay the same; the J704, J813 and J815 DTBs are identical once sorted. Signed-off-by: DjDeveloperr <hey@djdev.me>
|
Did the small items from the 12-02 status, so the J704 rerun can use the final tree:
The one blocker left is the resume hang. One J704 run at this head settles it. Either about 35 s2idle entries with |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: MERGE at 43a57e37, after the J704 hardware row below.
Blockers: none in the code. The open question from my earlier review is the J704 resume hang, and only that row can settle it.
Checked: the change is DT only, plus a file name in a comment in cpuidle-apple.c. I built the trees with cpp and dtc and compared them with main. J813 and J815 are unchanged apart from the PMU's now-implicit status = "okay". J704 gains cluster_pwrgate, the PMU, idle-states and cpu-idle-states on all ten CPUs, and nothing else. 43a57e37 only moves cluster_pwrgate after pmgr: all three trees are identical once sorted, and the dtc warnings are the same. No Apple material and no board gates: these are T8142 SoC facts, and cpuidle-psci still needs a /psci node.
Still owed before merge, on the J704 at this head, one of:
- about 35 s2idle entries with
cluster_pwrgateon, all clean; - about 35 with the node disabled, showing the hang also happens without it.
So far: 1 hang in 34 entries with the gate on, and none in 12 with it off. That data can't tell the two cases apart.
I reshaped the body into What/Tested/Risk/Not yet and corrected the J815 line: main already had the power gate there.
Evidence
b124bac5matches a clean merge with main.7549efa9goes beyond a clean merge in two files, where it drops the duplicatecluster_pwrgatefromt8142-j813-j815.dtsi; the tree comparison above covers that.- Compared
dtc -strees of t8142-j704, t8142-j813 and t8142-j815: main against43a57e37, andb124bac5against43a57e37.
What: Describe the T8142 CPU cluster power-gate enables, the CPU PMU and the PSCI retention idle state once in
t8142.dtsi, so the MacBook Pro 14-inch M5 (J704) gets them as the MacBook Airs (J813, J815) already do.Tested: J704 at earlier commits of this branch (rows in the comments): the PMU counts, the power gate driver probes, and cpuidle usage climbs on all ten CPUs under spin-table (
apple_idle). s2idle withcluster_pwrgateon: 33 of 34 entries over three boots, the one failure a resume hang; with the node disabled, 12/12. cpp + dtc against current main: the J813 and J815 trees are unchanged apart from the PMU's now-implicitstatus = "okay".Risk: two-way · T8142 (J704, J813, J815). Only the J704's tree changes in effect. Open question: the one J704 resume hang with
cluster_pwrgateon.Not yet: a J704 run at the PR head of about 35 s2idle entries with
cluster_pwrgateon, all clean, or about 35 with the node disabled to show the hang is unrelated. cpuidle-psci itself is untested on the J704, which needs the loader's PSCI monitor; the J704 runs so far booted under spin-table.Problem
On the MacBook Pro 14-inch M5 (J704), the boot P core never powers down in WFI,
perfhas no hardware counters, and cpuidle-psci has no idle state under the loader's PSCI monitor. The CPU cluster power-gate enables, the CPU PMU and the PSCI retention state were described only for the MacBook Airs:cluster_pwrgatesat in the Air-onlyt8142-j813-j815.dtsi.cpu_pmuwas enabled per board.t8142-j813-psci-idle.dtsi.These are CPU and PMGR facts of the T8142: the J704, J813 and J815 ADTs have the same
/cpusand the samepmgr.Change
cluster_pwrgateintot8142.dtsi, afterpmgr, ast8140.dtsidoes.cpu_pmuint8142.dtsi.t8142-j813-psci-idle.dtsitot8142-psci-idle.dtsiand include it fromt8142.dtsi. cpuidle-psci still only probes when a/pscinode is present.cpuidle-apple.c.Evidence
cpp + dtc, main against the PR head, decompiled trees compared node by node (
dtc -s):status = "okay", which is now implicit.cluster_pwrgate, the PMU, theidle-statesnode andcpu-idle-stateson all ten CPUs.dt-validate -mreported nothing new.J704 rows (term-guy, in the comments), all booted under spin-table (
apple_idle), so cpuidle-psci itself is untested on the J704:apple_t8142_pmuregisters 10 counters,perf stat -e cycles,instructions sleep 1counts.0x80000000(E +0x0, P +0x60); without this change the P word is 0.cluster_pwrgateon: 12/12 (11-26), then 9/10 and 12/12 on two more boots (11-27), so 33 of 34 entries; the one failure was a resume hang followed by a watchdog reset. With the node disabled: 12/12. Earlier, on 11-20 (before the merge with main), one hang in six entries.J813 (gig3m): cpuidle in use on every CPU, PMU counters, the sleep driver reads the power gate, 0 failed units. J815 (m0d16l14n1): boot-core idle residency 98.5 %, no cpuidle or PMU errors; its tree is the same with and without this change.
Still to run:
/sys/devices/system/cpu/cpu*/cpuidle/state*/usageclimbs on every CPU,perf statcounts, the cluster power-gate driver probes, s2idle cycles pass. Deep sleep stays off: the J704 has no sleep controller node yet.Details
cluster_pwrgatecame from gig3m (c58ab8c). The E/P words are in pmgr reg[34] at +0x0/+0x60, the same pmgr on all three boards.traces/kernel/20261119-dtfill-m5m6/(dts-idle, valm-idle-*).