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
…ery M5 The Neural Engine (with its three DARTs and ANE_SYS power state), the video encoder (two DARTs, VENC power tree) and both JPEG engines (DART, JPG power state) are SoC blocks: the J704, J813 and J815 ADTs give the same addresses, interrupts and power gates for ane, dart-ane, ave, dart-ave, jpeg0, jpeg1 and dart-jpeg. Only the J815 enabled all three and the J813 only the encoder (twice); the J704 had none of them. Turn them on in t8142-peripherals.dtsi and drop the per-board enables. The ANE and the encoder run firmware that iBoot preloads: the boot loader hands the preload over by compatible and disables the node when the ADT has none, so a board without a preload keeps them off. Every DART keeps its engine's power domain. The JPEG engines need no firmware. J815: no change in the built tree beyond status "okay" becoming implicit. J813: gains the Neural Engine and both JPEG engines. J704: gains all three. The ANE and JPEG enables on J815 come from m0d16l14n1's 33d8f13 and c3c1417. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…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. |
Conflicts: t8142-j813.dts, t8142-j815.dts (took integration: #1806 moved the board enables to t8142-j813-j815.dtsi and cluster_pwrgate there); dropped the now-redundant venc/ANE/JPEG enables from t8142-j813-j815.dtsi. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
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 every push, edit and review, and every 30 minutes. Rules: merge policy · labels. |
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_pwrgateexisted only int8142-j813.dts, so the J815 lacked it too.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, ast8140.dtsialready does.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.Testing
cpp + dtc before and after, decompiled trees compared node by node:
cluster_pwrgate.cluster_pwrgate, the PMU, theidle-statesnode andcpu-idle-stateson all ten CPUs.dt-validate -mreports nothing new on any of the three boards.Still to run
/sys/devices/system/cpu/cpu*/cpuidle/state*/usageclimbs on every CPU.perf stat -e cycles,instructions sleep 1counts.Details
t8142-j813.dtsnext to each other).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-*).