Skip to content

arm64: dts: apple: t6041: wire pmc_soc_max perf floor to AVD and AVE - #2751

Merged
RyanTheTide merged 2 commits into
aurora-silicon:integration/aurorafrom
AxxzyWasTaken:feat/t6041-pmc-soc-max
Nov 23, 2026
Merged

RyanTheTide merged 2 commits into
aurora-silicon:integration/aurorafrom
AxxzyWasTaken:feat/t6041-pmc-soc-max

Conversation

@AxxzyWasTaken

@AxxzyWasTaken AxxzyWasTaken commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Add the pmc_soc_max (label = "soc-vmax", apple,rail = <1>, apple,level = <2>) power domain under &pmc in t6041.dtsi and wire it as the "perf" power domain for &avd and &ave.

Rationale (J616c ADT)

  • /arm-io/pmgr voter-rail-data: rail[1] is the SOC rail, ap-voter-agent-idx = 3 (matches the existing apple,static-voters = <1 3>).
  • SOC rail level 2 is the level the ADT's AVD-SOC-VMAX / VENC0-SOC-VMAX entries request and already reaches the maximum SOC fabric clock; level 3 only raises it further for CPU/GPU demand.

Verification

  • dtbs, dt_binding_check, CHECK_DTBS=y for J616c/J614c/J575c: 0 warnings/errors; power-domain names/order match apple,avd.yaml and apple,t8140-ave.yaml (CI dt-checks and host-tests green on fa1e8e3e772e).
  • checkpatch.pl --strict: clean (0 errors, 0 warnings, 0 checks on 02829ba72a82 and fa1e8e3e772e).
  • J616C (M4 Max 16c/32g) AVD + apple-pmc floor row: DTB from fa1e8e3e772e, kernel 7.3.0-j616c-wave1+ (base 606d37ec77a5, 2026-11-22 09:35 UTC):
    • /proc/device-tree/power-management@5048aa000/floor-soc-max (label = "soc-vmax"), /proc/device-tree/avd@280000000/power-domain-names = "core", "perf"; avd 281080000.avd probed cleanly; FAILED_UNITS=0.
    • Before / after (t+1s) AVD decode: agent3 floor: 0x00000000 honoured: 0x00000000, pmc-soc-vmax: rail1 level 2 released.
    • During 4K AV1 HW decode (LIBVA_DRIVER_NAME=v4l2_request ffmpeg -hwaccel vaapi -i av1_2160.mkv -f null -, 3840x2160 NV12, 90 frames in 0.497s = 181.1 fps / 6.04x realtime, exit 0): agent3 floor: 0x00000020 honoured: 0x00000020, pmc-soc-vmax: rail1 level 2 held (pmc-soc-vmax on, genpd:1:281080000.avd active).
    • @RyanTheTide APPROVED (2026-11-22 09:51 UTC).
  • Remaining &ave "perf" verification scope: &ave "perf" floor wiring is still untested on hardware (&ave is disabled on J616c/J614c and already enabled on t6041-j575c.dts); @DjDeveloperr (09:56 UTC) holds approval pending either a J575c AVE encode row on fa1e8e3e772e, a J616c AVE encode run with &ave + &pmc_soc_max active (with owner waiver for J575c), or splitting &ave to a follow-up. §5 regression counts (0 SELinux denials, 0 new kernel errors) not yet reported; J614c and J575c remain untested.

Assisted-by: LLM (Anthropic:Claude Opus 5.5, Google:Gemini 4 Neon)

@RyanTheTide

Copy link
Copy Markdown
Contributor

The domain and wiring match the T6040 shape (t6040.dtsi pmc_soc_max, avd/ave perf), and the name order is what each driver expects: avd-drv.c and ave-drv.c take an optional trailing "perf", and ane_h16_backend.c:1733 takes six domains only when "perf" is at index 5. pmc.c accepts rail 1 / level 2 on the t6041-pmc table. The comment's explanation of why level 2 (VMAX) and not 3 is clear.

  • t6041.dtsi:23-27 (&ane): on T6041 the CLPC table already votes SoC state 2 for every EXECUTE (clpc.c:1688, apple_clpc_hw_t6041.ane[APPLE_CLPC_SOC] = 2, called from ane_h16_busy() just before the perf get). So the ANE perf floor asks for the same level on the same rail. That is harmless, but please show it changes something: ANE latency with and without the floor on J616c. If it doesn't, drop the ANE hunk. J616s also only wires AVD and AVE in t6040.dtsi.
  • t6041.dtsi:366 label soc-max: on T6041 this is not the top SoC state (state 3 exists). Something like soc-vmax would avoid confusion when reading apple-pmc debugfs. Nit.
  • J575c already enables &ave (t6041-j575c.dts:1369), so this changes an encode path that is already live there. It needs a J575c encode row (fps before and after, floor released when idle), not only J616c.

Rows needed at 4891651: J616c apple-pmc status showing the rail-1 floor taken and released around an AVD decode and an ANE run, with throughput numbers; J575c AVE encode.

Assisted-by: LLM (Claude:Opus 5.5)

Define the pmc_soc_max (floor-soc-max) power domain under &pmc on T6041
using rail 1 (SOC, verified from J616c ADT /arm-io/pmgr voter-rail-data)
and AP static voter agent 3 (already listed in apple,static-voters).

Unlike M4 Pro (T6040, SOC states 0..2), M4 Max (T6041) exposes four SOC
states (0..3 in J616c ADT /arm-io/pmp/iop-pmp-nub dvfs-domain and pmgr
voltage-states0/28/29). State 2 (VMAX, 815 mV) already reaches the
maximum SOC_AFC clock (2004 MHz) and matches ADT AVD-SOC-VMAX (0x19c)
and VENC0-SOC-VMAX (0x198), while state 3 (VOVD, 820 mV) only raises
SOC_AFI (975 -> 1300 MHz) and is driven by CLPC for CPU/GPU demand.
Use level 2 here with label "soc-vmax" to match the ADT VMAX floor
without implying the top VOVD state in apple-pmc debugfs.

Signed-off-by: AxxzyWasTaken <[email protected]>
Attach the PMC SoC rail floor domain (&pmc_soc_max) as the "perf" power
domain on &avd and &ave in t6041.dtsi, matching T6040 (t6040.dtsi) and
the existing AVD and AVE bindings and drivers.

&ane is intentionally left without the PMC floor: on T6041,
apple_clpc_hw_t6041 already votes SoC state 2 for every ANE EXECUTE
(clpc.c: apple_clpc_hw_t6041.ane[APPLE_CLPC_SOC] = 2) and active CPU
demand votes SoC state 3 (VOVD).

All T6041 boards (J616c, J614c, J575c) enable &pmc. On J616c and J614c
&ave remains disabled until brought up; on J575c &ave is already enabled
and now receives the VMAX SoC floor alongside &avd.

Signed-off-by: AxxzyWasTaken <[email protected]>
@AxxzyWasTaken AxxzyWasTaken changed the title arm64: dts: apple: t6041: add pmc_soc_max perf floor and wire AVD, AVE, and ANE arm64: dts: apple: t6041: wire pmc_soc_max perf floor to AVD and AVE Nov 22, 2026
@AxxzyWasTaken

Copy link
Copy Markdown
Contributor Author

Updated to fa1e8e3e772e addressing both code review points (preserving human Signed-off-by:):

  • Dropped &ane (fa1e8e3e772e): Confirmed apple_clpc_hw_t6041 already votes .ane[APPLE_CLPC_SOC] = 2 (and active CPU demand votes state 3 VOVD with sustain = 0), so &pmc_soc_max now wires strictly to &avd and &ave, matching t6040.dtsi.
  • Renamed label (02829ba72a82): Changed label = "soc-max" → label = "soc-vmax" so apple-pmc debugfs reflects VMAX (level 2) rather than implying VOVD (level 3).
  • Verified: checkpatch.pl --strict 0 errors / 0 warnings / 0 checks on both commits; CHECK_DTBS=y clean across t6041-j616c.dtb, t6041-j614c.dtb, and t6041-j575c.dtb.

Next up: exact-head J616c apple-pmc floor + AVD decode row (and welcoming a J575c AVE encode row before merge).

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks, fa1e8e3 takes both: the &ane hunk is gone (the CLPC already votes that level per execute) and the label reads soc-vmax, so the wiring now matches t6040.dtsi. Code is fine. The rows are still the gate: the J616c apple-pmc floor taken and released around an AVD decode with throughput numbers, and the J575c encode row (fps before/after, floor released when idle), since its AVE path is already live. We have no J575c to offer for that one.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Adversarial review at live head fa1e8e3e772e29920d41eed93ae83d10e2832338 against the pre-PR checklist: 0 code/policy/attribution/CI blockers. Holding with COMMENT solely for missing §5 hardware verification rows on the live head.

Checked & clean

  • §1–§2 No model gating / no hacks: Pure DT description of the T6041 SoC fabric rail floor and AVD/AVE consumer wiring.
  • §3 Deep DT, binding & driver correctness (arch/arm64/boot/dts/apple/t6041.dtsi):
    • pmc_soc_max: floor-soc-max (apple,rail = <1>, apple,level = <2>, label = "soc-vmax") matches apple,pmc.yaml and drivers/pmdomain/apple/pmc.c (apple_pmc_hw_t6040: rails = 4, agent_rails = GENMASK(1, 0), ap_agent = 3, with apple,static-voters = <1 3> present on &pmc). Naming the domain label = "soc-vmax" (pmc-soc-vmax in debugfs) accurately reflects T6041's state 2 VMAX floor without implying state 3 VOVD.
    • &avd ("core", "perf") matches apple,avd.yaml and drivers/media/platform/apple/avd/avd-drv.c:683-692 (devm_pm_domain_attach_list() with PD_FLAG_DEV_LINK_ON), mirroring t6040.dtsi.
    • &ave ("dma", "pipe4", "pipe5", "me0", "me1", "perf") matches apple,t8140-ave.yaml and drivers/media/platform/apple/ave/ave-drv.c:427-485, mirroring t6040.dtsi.
    • Dropping &ane in fa1e8e3e is the right call since apple_clpc_hw_t6041 already votes SoC state 2 on ANE EXECUTE.
    • All T6041 boards (t6041-j614c-j616c.dtsi, t6041-j575c.dts) enable &pmc (status = "okay").
  • §4 Attribution: Both commits (02829ba72a82, fa1e8e3e772e) carry human author/committer (AxxzyWasTaken <[email protected]>) and human Signed-off-by: only (zero AI trailers); PR body includes Assisted-by:.
  • CI: Both dt-checks (0 new warnings across 138 DTBs) and host-tests are green on fa1e8e3e772e.
  • §6 Naming: Clean.

Remaining §5 hardware rows needed before APPROVE

  1. J616c (T6041) on live head fa1e8e3e772e (default kernel command line): /sys/kernel/debug/apple-pmc/*/status showing pmc-soc-vmax: rail1 level 2 held during an active AVD decode and released when idle, with before/after AVD decode throughput numbers, plus full §5 regression summary (0 SELinux denials, 0 failed units, 0 new kernel errors).
  2. J575c (T6041) on live head fa1e8e3e772e (since &ave is already enabled in t6041-j575c.dts:1369): AVE encode before/after fps/throughput and apple-pmc status showing pmc-soc-vmax held during encode and released when idle, plus §5 regression summary (or explicit owner sign-off if no J575c is available).

Non-blocking nit

  • The PR description still mentions &ane / apple,ane.yaml from before fa1e8e3e dropped the ANE hunk — please trim those references so the body matches the live diff.

Assisted-by: LLM (Gemini 4 Neon)

@AxxzyWasTaken

Copy link
Copy Markdown
Contributor Author

Trimmed the stale &ane / apple,ane.yaml references from the PR description to match live head fa1e8e3e772e. J616c AVD decode + apple-pmc status row remains queued once our test box reconnects.

@AxxzyWasTaken

Copy link
Copy Markdown
Contributor Author

J616C (M4 Max 16c/32g) exact-head boot & AVD/PMC floor verification at fa1e8e3e772e (built on wave1 base 606d37ec77a5, 7.3.0-j616c-wave1+, Stage 2 1.0.0b14-g6ac0495f, t6041-j616c-pr2751.dtb):

  • DT & probe: /proc/device-tree/power-management@5048aa000/floor-soc-max (label = "soc-vmax"), /proc/device-tree/avd@280000000/power-domain-names = "core", "perf". avd 281080000.avd probed cleanly (/dev/video12, /dev/media0, hw version 40010, open-queue transport, 15 frames in flight); FAILED_UNITS=0.
  • Before AVD decode (/sys/kernel/debug/apple-pmc/5048aa000.power-management/status & pm_genpd_summary):
    • agent3 floor: 0x00000000 honoured: 0x00000000
    • pmc-soc-vmax: rail1 level 2 released (pmc-soc-vmax off-0, genpd:1:281080000.avd suspended)
  • During 4K AV1 HW decode (LIBVA_DRIVER_NAME=v4l2_request ffmpeg -hwaccel vaapi -i av1_2160.mkv -f null - — 3840x2160 NV12, 90 frames in 0.497s = 181.1 fps / 6.04x realtime, exit 0):
    • agent3 floor: 0x00000020 honoured: 0x00000020
    • pmc-soc-vmax: rail1 level 2 held (pmc-soc-vmax on, genpd:1:281080000.avd active)
  • After AVD decode (t+1s):
    • agent3 floor: 0x00000000 honoured: 0x00000000
    • pmc-soc-vmax: rail1 level 2 released (pmc-soc-vmax off-0, genpd:1:281080000.avd suspended)

(AVE perf attachment shares the same pmc_soc_max floor; AVE bring-up itself is carried separately on #2266 / #2778.)

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The J616C row shows the soc-vmax floor released at idle and held during an AV1 decode, with the &ane hunk gone. Approving on that. The J575c encode path, live already there, still has no row and we can't supply one; please add it if anyone with a J575c can.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-reviewed live head fa1e8e3e772e29920d41eed93ae83d10e2832338 (02829ba72a82, fa1e8e3e772e) after the PR description cleanup and the exact-head J616C AVD/PMC floor row.

Verified (0 code/policy/attribution/CI blockers)

  • Scope & DT/driver correctness (§1–§4, §6): Strictly T6041-only (arch/arm64/boot/dts/apple/t6041.dtsi; no T6040 or other SoC family is touched, so no non-T6041 row is needed). PR description now matches the live diff (&ane references removed), both commits have human Signed-off-by: only, and dt-checks + host-tests are green.
  • §5 J616C AVD + PMC floor proof (fa1e8e3e772e): Cleanly verified! pmc-soc-vmax transitioned from agent3 floor: 0x00000000 honoured: 0x00000000 (released) -> 0x00000020 / 0x00000020 (rail1 level 2 held) during 4K AV1 HW decode (90 frames in 0.497s = 181.1 fps / 6.04x realtime, exit 0) -> back to 0x00000000 (released) at t+1s, with FAILED_UNITS=0.

Still holding APPROVE on one remaining §5 gap (within T6041)

  • &ave "perf" floor wiring is still untested on hardware. t6041.dtsi modifies &ave's power-domains/power-domain-names to add "perf" (&pmc_soc_max), which is already live on t6041-j575c.dts:1369 (while &ave remained disabled in the J616C fa1e8e3e772e boot). As noted in both earlier reviews, we still need hardware coverage for the &ave "perf" path before approving this hunk:
    • A J575c AVE encode row on fa1e8e3e772e showing pmc-soc-vmax held during encode and released when idle (with encode fps before/after), or
    • If no J575c is available, either an AVE encode run on J616c with &ave + &pmc_soc_max both active (confirming pmc-soc-vmax is held/released around an encode with explicit owner waiver for J575c), or dropping the &ave hunk to a follow-up so #2751 can land on the verified J616C AVD proof alone.

Assisted-by: LLM (Gemini 4 Neon)

@RyanTheTide

Copy link
Copy Markdown
Contributor

@AxxzyWasTaken status against integration/aurora daa9e2d: this merges cleanly and t6041.dtsi on the tip has no pmc_soc_max yet, so it is still needed. Two things changed on the tip since cacf355: the first encoder is now enabled on every M4 Max (f051544), so the AVE encode row that is still owed can be run on your J616c instead of waiting for a J575c; and a second encoder node, ave1, was added (22112f0, disabled) without a perf domain. Could you add the J616c encode row (fps before and after, the floor held during the encode and released after), and say whether ave1 should take the same floor?

@AxxzyWasTaken

Copy link
Copy Markdown
Contributor Author

Thanks for checking against daa9e2de!

  • J616c AVE encode row: Yes — we already have #2751 rebased onto integration/aurora (with f0515446 &ave enabled on J616c) and a verified DTB ready, and will post the exact J616c AVE encode before/after FPS + pmc-soc-vmax held/released row as soon as our J616C hardware lane is back online.
  • On ave1: In the J616C ADT (ave1, soc-id = "t6041", compatible = "ave2", coprovider-group = "ave", same function-mcc_dataset and 9 power-gate layout as ave0), ave1 is the identical second AVE2 encoder on the same SoC fabric rail, so architecturally it should take the same "perf" = <&pmc_soc_max> floor once enabled. Since ave1 is currently status = "disabled" on all boards in t6041.dtsi (and can't be hardware-tested under #2751), I'd prefer to keep &ave1 untouched here and attach "perf" = <&pmc_soc_max> in the PR that enables ave1 so every wired node ships with a live encode row rather than untested DT wiring.

Assisted-by: LLM (Google:Gemini 4 Neon)

@AxxzyWasTaken

Copy link
Copy Markdown
Contributor Author

J616C (MacBook Pro 16" M4 Max, T6041) same-machine &ave encode + &avd decode A/B on integration/aurora (e0a9448a75df, 7.3.0-j616c-int-aurora, where #2266 enables &ave on J616C), comparing base DTB vs #2751 DTB (fa1e8e3e rebased onto e0a9448a75df, &ave + &avd wired to pmc_soc_vmax "perf"):

Workload (1080p60 synthetic NV12, raw stream) Base DTB (no pmc-soc-vmax) #2751 DTB (pmc-soc-vmax) Delta & PMC state
AVE H.264 encode (h264_v4l2m2m, 240f, 8M) 1.743 s (137.7 fps), 4,035,444 B 1.371 s (175.1 fps), 4,035,444 B (byte-identical) +27.2%, agent3 floor: 0x20 honoured: 0x20, rail1 level 2 held (48 samples) → released after 2 s autosuspend
AVE HEVC encode (hevc_v4l2m2m, 240f, 8M) 2.022 s (118.7 fps), 4,019,809 B 1.369 s (175.3 fps), 4,019,809 B (byte-identical) +47.7%, agent3 floor: 0x20 honoured: 0x20, rail1 level 2 held (54 samples) → released after 2 s autosuspend
Isolated AVD H.264 decode (v4l2_request VA-API, 600f) 0.217 s (240f) 0.373 s (600f) Clean released (0x0) → rail1 level 2 held (29 samples) → released (0x0)
  • Idle verification (pm_genpd_summary + /sys/kernel/debug/apple-pmc/5048aa000.power-management/status):
    • Idle pre- and post-workload (>2 s after AVE exit / 2 s after AVD exit): agent3 floor: 0x00000000 honoured: 0x00000000, pmc-soc-vmax: rail1 level 2 released, pmc-soc-vmax off-0, all 283100000.video-codec and 281080000.avd genpds suspended.
  • Health: 0 failed systemd units, 0 new dmesg errors across all runs.

Assisted-by: LLM (Google:Gemini 4 Neon)

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-review at live head fa1e8e3e772e29920d41eed93ae83d10e2832338 following the J616C &ave + &avd A/B hardware row: all prior §5 holds are resolved — approving.

Verification of prior §5 hold

  • In our previous review (fa1e8e3e772e), §1–§4, §6, CI (dt-checks + host-tests), and the exact-head J616C AVD + pmc-soc-vmax row were already verified clean, with approval held solely for hardware verification of the &ave "perf" power-domain wiring.
  • Now that f0515446 enables &ave on every M4 Max in integration/aurora, the newly posted same-machine J616C A/B row (integration/aurora e0a9448a75df, base DTB vs #2751 DTB) cleanly closes that gap:
    • AVE H.264 encode (h264_v4l2m2m, 240f, 8M): 137.7 -> 175.1 fps (+27.2%, byte-identical output), agent3 floor: 0x20 honoured: 0x20, pmc-soc-vmax: rail1 level 2 held (48 samples) -> released after 2 s autosuspend.
    • AVE HEVC encode (hevc_v4l2m2m, 240f, 8M): 118.7 -> 175.3 fps (+47.7%, byte-identical output), agent3 floor: 0x20 honoured: 0x20, pmc-soc-vmax: rail1 level 2 held (54 samples) -> released after 2 s autosuspend.
    • Isolated AVD H.264 decode + idle verification: clean released (0x0) -> rail1 level 2 held -> released (0x0), pmc-soc-vmax off-0, all AVD/AVE genpds suspended when idle; 0 failed systemd units and 0 new dmesg errors across all runs.
  • Re-checked against live integration/aurora tip (808a754659cf): #2751 still merges cleanly (MERGEABLE / CLEAN) with f0515446's &ave { status = "okay"; }, and keeping disabled &ave1 deferred to the ave1 enablement PR is the right call so no untested DT wiring lands.
  • §4 Attribution & live CI: Both commits (02829ba72a82, fa1e8e3e772e) have human author/committer and human Signed-off-by: only (zero AI trailers); dt-checks and host-tests are green (SUCCESS).

Non-blocking nits

  • The PR description still carries the pre-AVE "untested" note; updating it is optional.
  • Comment 7093311547 reported 0 failed systemd units and 0 new dmesg errors without explicitly printing the SELinux AVC denial count, which is non-blocking here given this is pure DT power-domain wiring with no userspace/SELinux surface.

Assisted-by: LLM (Gemini 4 Neon)

@RyanTheTide
RyanTheTide merged commit 5441428 into aurora-silicon:integration/aurora Nov 23, 2026
2 checks passed
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.

3 participants