Skip to content

arm64: dts: apple: t6040, t8142: name the ANE CPU floor OPP (apple,ane-cpu-opp) - #3741

Merged
RyanTheTide merged 3 commits into
mainfrom
gates/clpc-power-profile
Dec 5, 2026
Merged

RyanTheTide merged 3 commits into
mainfrom
gates/clpc-power-profile

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

What: DT-only. The CLPC already prefers apple,ane-cpu-opp (an OPP in the CPU table of the cluster whose frequency sets the ANE's speed) and falls back to the table's ane_cluster_machine match without it. T6040 and T8142 still used that fallback. This names the measured floor OPP for them, as the T6050 and T8132 trees do:

  • t6040.dtsi: &clpc { apple,ane-cpu-opp = <&t6040_p1_opp_3756>; } (opp12, 3.756 GHz, second P-cluster table = cpu-map cluster2, same as the table's ane_cluster = 2, ane_cluster_khz = 3756000).
  • t8142-j813-j815.dtsi and t8142-j704.dts: apple,ane-cpu-opp = <&pcluster_opp_4176> (4.176 GHz P-cluster OPP = cluster1, ane_cluster_khz = 4176000).

No driver or binding change (apple,ane-cpu-opp is already in power/apple,pmc.yaml). main's ane_cluster_machine and high_power_machine fallbacks stay; dropping them is a later driver change once the fleet's Stage 2 DTBs carry the properties.

Behaviour: on T6040 (J614s, J616s, J773s) and J813/J815 the driver resolves the same CPU cluster and floor frequency as the fallback does today. J704 has no /cpus/cpu-map, so on main the fallback finds no cluster there (apple_clpc_cluster_cpu() returns -ENODEV) and J704 gets no CPU floor; with the property it gets the 4.176 GHz floor that J813 measured (same SoC). DTBs whose Stage 2 copy predates this keep the fallback, so nothing regresses before a Stage 2 refresh.

This replaces the branch's earlier content (a new boolean apple,ane-cluster-floor, driver reading it, and removal of the j714s High Power fallback); that is gone after the merge of main.

Tested (local, merge of main ef8a1bf): make CHECK_DTBS=y for t6040-j614s/j616s/j616s-tether/j773s and t8142-j704/j813/j815: builds, no new warnings (the only one is the existing disp0_piodma alias on j813). The phandle in each DTB resolves to opp-hz 3756000000 (T6040) / 4176000000 (T8142). dt_binding_check DT_SCHEMA_FILES=power/apple,pmc.yaml clean.

Rows: J616s (lab) with a Stage 2 DTB from this head: ANE work (MobileNetV1 loop) holds cluster2 at >= 3.756 GHz (scaling_min_freq/QoS while in flight), released after. T8142 (J813/J815/J704) rows for whoever has those Macs.

Tested: build only at 5504c96 (CHECK_DTBS, dt_binding_check clean); no hardware run at this head yet, J616s row queued.
Risk: two-way · M4 Pro family (T6040: J614s, J616s, J773s) and M5 (T8142: J704, J813, J815); J704 gains an ANE CPU floor it lacked.

The ANE CPU cluster floor applied only where the root compatible matched
a machine name kept in the table (apple,t6040, apple,t8142), and High
Power mode had a fallback on the apple,j714s machine name for DTBs from
before apple,high-power-mode.

Add a boolean apple,ane-cluster-floor on the CLPC node of the machines
where the floor was measured (T6040 in t6040.dtsi, T8142 J704 and
J813/J815), document it in the PMC binding, and read it instead of the
machine name. Drop the j714s fallback: t6050-j714s.dts has carried
apple,high-power-mode since linux#2784.

For every in-tree DTB the resolved ANE floor and High Power mode are the
same as before.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Draft sweep 12-05: parked; main changed the design under this PR.

  • main now selects the ANE CPU floor from the CLPC node's apple,ane-cpu-opp phandle (apple_clpc_ane_cpu_opp(), drivers/soc/apple/clpc.c ~1907/2323; used by t6050-die0.dtsi, t6050-j775c.dts and t8132.dtsi). The table's ane_cluster_machine match is now only the fallback when that property is absent (-ENOENT). So the boolean apple,ane-cluster-floor this PR adds is the wrong property: T6040 and T8142 should get apple,ane-cpu-opp pointing at the OPP their measured floor is (as the T6050/T8132 trees do), and the binding text should not gain a second mechanism.
  • main also kept the high_power_machine fallback on purpose ("a DTB from before the property ... keeps High Power mode"), which is the same one-way-door risk this PR's description flags: the live J616s Stage 2 DTB has neither property.
  • Merging main conflicts in clpc.c, apple,pmc.yaml and t8142-j813-j815.dtsi on exactly those points.

Suggested path (owner call): (1) a DT-only change adding apple,ane-cpu-opp to t6040.dtsi, t8142-j704.dts and t8142-j813-j815.dtsi (no driver change; main already prefers it); (2) after the fleet's Stage 2 DTBs carry apple,ane-cpu-opp and apple,high-power-mode (Stage 2 refresh, not done by this sweep), a small driver change dropping both machine fallbacks. This PR's head would then be closed in favour of those two.

Conflicts in drivers/soc/apple/clpc.c, apple,pmc.yaml and
t8142-j813-j815.dtsi resolved to main's version: main reads the ANE
CPU floor from apple,ane-cpu-opp. The next commit replaces the rest of
this branch's apple,ane-cluster-floor property with that one.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The CLPC holds the CPU cluster whose frequency sets the Neural Engine's
speed at a floor while ANE work is in flight. On T6040 and T8142 it
finds that cluster and floor only through a machine-compatible match in
its table (apple,t6040: cpu-map cluster2 at 3.756 GHz; apple,t8142:
cluster1 at 4.176 GHz), the fallback for DTBs without
apple,ane-cpu-opp.

Point apple,ane-cpu-opp at the measured floor OPP in the CPU tables, as
the T6050 and T8132 trees do: opp12 (3.756 GHz) of T6040's second
P-cluster table, and the 4.176 GHz P-cluster OPP on J704 and J813/J815.
The driver resolves the same cluster and frequency from it on T6040 and
J813/J815. J704 has no /cpus/cpu-map, so the fallback found no cluster
there and the property gives it the floor for the first time.

Drop this branch's earlier apple,ane-cluster-floor boolean and driver
change; the machine-name fallbacks stay until the Stage 2 DTBs carry
the property.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide RyanTheTide changed the title soc: apple: clpc: take the ANE cluster floor and High Power from the DT arm64: dts: apple: t6040, t8142: name the ANE CPU floor OPP (apple,ane-cpu-opp) Dec 5, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Second pass 12-05: redone as DT-only on main. Merged main (ef8a1bf, conflicts resolved to main), then 5504c96 replaces the branch content: apple,ane-cpu-opp on the T6040 and T8142 CLPC nodes pointing at the measured floor OPPs (3.756 GHz cluster2 / 4.176 GHz cluster1). No driver or binding change; main's machine-name fallbacks stay until a Stage 2 DTB refresh. Local CHECK_DTBS on the 7 affected DTBs: no new warnings, phandles resolve to the expected opp-hz; pmc.yaml dt_binding_check clean. Note: J704 has no cpu-map, so it gains the floor it never got from the fallback. Row queued: J616s with a Stage 2 DTB from this head (ANE in flight holds cluster2 >= 3.756 GHz). T8142 rows open for owners. Marking ready.

@RyanTheTide
RyanTheTide marked this pull request as ready for review December 5, 2026 02:09
@RyanTheTide
RyanTheTide requested review from a team as code owners December 5, 2026 02:10
@github-actions github-actions Bot added area:bringup Area from CODEOWNERS (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot) labels Dec 5, 2026
@github-actions

github-actions Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

Merge readiness at 5504c96d: not ready yet

Check Detail
CI at head running running: pr-text / pr-text
Review no approved by aurora-silicon-review, but GitHub does not count it yet (code owner from Core, Omarchy Mac or Aurora Maintainers needed, or approval went stale)
Requested changes ok none
Hardware row at head ok comment at 5504c96d
Conflicts ok none
PR text ok Risk: two-way · M4 Pro family (T6040: J614s, J616s, J773s) and M5 (T8142: J704, J813, J815); J704 gains an ANE CPU floor it lacked.

Areas: area:bringup

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@github-actions github-actions Bot added the ci-failing A check failed at the PR head (bot) label Dec 5, 2026

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: FINISH at 5504c96

Failure: The exact PR-text job rejects the description because the Tested and Risk lines are missing. The current Testing heading includes extra words before its colon, and the body has no Risk line. Add plain Tested and Risk lines, distinguishing the seven validated DTBs and the physical rows still pending. The check reruns on a description edit. https://github.com/aurora-silicon/linux/actions/runs/47465868828/job/145502403293

Checked: All seven exact DTBs compile, and each CLPC phandle resolves to an OPP used by the intended CPU table. The T6040 boards select 3.756 GHz, and the three T8142 boards select 4.176 GHz. The J704 table is referenced by four CPUs, so the driver can resolve it without a CPU map. The existing driver and fallback are outside the diff. Exact hosted DT and Host test jobs passed.

@github-actions github-actions Bot added the changes-requested A reviewer requested changes (bot) label Dec 5, 2026

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at 5504c96

Checked: The edited PR description includes the Tested and Risk fields and passes the current canonical PR-text checker, including the author's commits. The empty-body control fails as expected. This resolves my prior description finding. The source SHA matches the seven devicetrees previously checked. Their CPU OPP phandles resolve to the intended clusters and rates, and the released-DT fallback stays available.

Hosted DT and Host passed. The hosted rerun for the edited description and native rows remain open.

@github-actions github-actions Bot added blast:m4 Macs affected, from Merge risk (bot) blast:m5 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) and removed changes-requested A reviewer requested changes (bot) needs-template PR body lacks Tested or Risk (bot) labels Dec 5, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Hardware row at exact head 5504c96d6dc0 on the J616s: PASS.

  • The second P cluster (opp-table-p1 = cpus 9-13, cpufreq policy9) idles at 1260 MHz.
  • During an H16G MobileNetV1 loop on /dev/accel/accel0 (60000 runs, top-1 16/16) policy9 held 3756 MHz in 20 of 20 samples (every 0.5 s); the first P cluster and E cluster did not move.
  • Right after the loop policy9 was back at 1260 MHz (6 samples). The kernel logs H16 stage 5 program window ..., CLPC input attached.

How: one combined test kernel for eight PRs, not this PR alone. Kernel 7.3.0-aurora-ci = main d0684a06 + merge commits of linux#2371 59f4d06c, #2350 5f18911e, #2361 cbabdb3a, #3741 5504c96d, #1814 775f31d2, #2305 8ff4c110, #2712 b6887f88, #2398 75b30c6c (all merged clean, test commit eb57c039, cloud build https://github.com/aurora-silicon/linux/actions/runs/47486534991). Booted as a one-shot on the lab J616s (M4 Pro, T6040, 26.6.2 stub) with this kernel's own J616s DTBs (plain and tether variants) in a trial Stage 2 (live aura 1.0.0b19 + U-Boot, only the DTBs swapped), default cmdline, silent. PR-kernel boots: 0 error-level kernel lines, 0 AVC, 0 failed units. Note: the #1814 hibernation dry run reset this kernel once (see linux#1814); the rest ran on a re-armed boot of the same kernel. Saved default restored after.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Merging with --merge --admin under the six-point gate: CI green at exact head 5504c96d6dc0 (dt-checks, host-tests, readiness, and pr-text on the updated PR description at 07:51:28Z all SUCCESS; the 08:38Z rerun only replayed the stale pre-edit payload), independent review approval (aurora-silicon-review at 5504c96d6dc0, no unresolved CHANGES_REQUESTED), exact-head J616s ANE CPU floor hardware row posted above (20/20 samples at 3756 MHz during 60k H16G MobileNetV1 runs), no taint, no Stage 1 / 1TR / LocalPolicy / default-boot changes. Revert path: git revert -m 1 <merge-sha>.

@RyanTheTide
RyanTheTide merged commit 8810a4e into main Dec 5, 2026
8 of 14 checks passed
@RyanTheTide
RyanTheTide deleted the gates/clpc-power-profile branch December 5, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:bringup Area from CODEOWNERS (bot) blast:m4 Macs affected, from Merge risk (bot) blast:m5 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant