Skip to content

soc: apple: clpc: raise T6050 GPU busy fabric top state to 3 - #3992

Merged
DjDeveloperr merged 1 commit into
mainfrom
feat/clpc-t6050-gpu-fabric3
Dec 2, 2026
Merged

DjDeveloperr merged 1 commit into
mainfrom
feat/clpc-t6050-gpu-fabric3

Conversation

@erikwb

@erikwb erikwb commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

What: Allow T6050 DT GPU busy-share ladders to reach memory fabric state 3 at the top busy column (>= 800‰) via a dedicated gpu_max validation ceiling in clpc.c (preserving the 6/2 fallback floor and ANE debugfs ceiling), and raise the top column of apple,gpu-busy-memory-states from <0 0 0 2> to <0 0 0 3> in t6050-die0.dtsi and t6050-j775c.dts.

Tested:

  • J716c (T6050, M5 Max) at 23cd587389ae (trial kernel built from main d3de772ac0c1 + this PR + G17 M5 ordered-partial PR, default cmdline):
    • Boot log shows 0 CLPC invalid-ladder warnings; live DT /sys/firmware/devicetree/base/soc@200000000/power-management@286806000/performance-controller@1/apple,gpu-busy-memory-states reads (1, 2, 4, 6, 0, 0, 0, 3).
    • /sys/kernel/debug/apple-pmc/286806000.power-management/status reads agent1 floor: 0x00000000 honoured: 0x00000000 at idle (both before and after load) and agent1 floor: 0x00000036 honoured: 0x00000036 (DCS 6 / fabric 3) under saturated Cyberpunk 2077 2.5 T2 GPU load (55.38 FPS, 0 Asahi faults, 0 pstate-1 clamps).
  • KUnit, DT schema, checkpatch, kernel-doc, and host tests at 23cd587389ae:
    • 22/22 CLPC KUnit tests PASS in QEMU (drivers/soc/apple/clpc.kunitconfig).
    • tools/asahi/clpc-gpu-demand-tests.py: PASS (all positive cases + all 44 negative controls, including t6050-j775c.dts parity).
    • make ARCH=arm64 LLVM=1 CHECK_DTBS=y apple/t6050-{j716c,j775c,j714s,j775d}.dtb: 0 CLPC/PMC schema warnings.
    • checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks; scripts/kernel-doc -none drivers/soc/apple/clpc.c: 0 warnings.

Risk: two-way door · T6050 boards (t6050-die0.dtsi and t6050-j775c.dts).

Not yet: Runtime verification on M5 Pro boards (j714s/j716s/k114s/k116s/j873s), J775c, and J775d.

Details
  • ca3e29829786 previously lowered apple_clpc_hw_t6050.gpu[SOC] from 3 to 2 because microbenchmarks saw no speedup while holding fabric 3 at idle cost extra power. With the GPU busy-share ladder, lower columns (< 800‰) and idle remain at fabric 0, so fabric 3 is only requested when the GPU reports >= 800‰ busy (helping fill/bandwidth-bound workloads without raising idle or light-load power).
  • apple_clpc_hw_t6050.gpu stays {6, 2} so the no-ladder fallback and ANE debugfs ceiling are unchanged; a separate u8 gpu_max[APPLE_CLPC_RAILS] = {6, 3} supplies the DT validation ceiling in apple_clpc_dt_map(), accepting fabric 3 while still rejecting fabric 4 and DCS 7.
  • Updated both t6050-die0.dtsi and the standalone t6050-j775c.dts to <1 2 4 6>, <0 0 0 3>, added apple_clpc_t6050_policy_test in clpc.c, and updated tools/asahi/clpc-gpu-demand-tests.py (including standalone J775c ladder parity).
Evidence
KUnit (23cd587389ae):
  ./tools/testing/kunit/kunit.py run --arch arm64 --make_options LLVM=1 --kunitconfig drivers/soc/apple/clpc.kunitconfig
  -> 22/22 PASS (apple-clpc-gpu + apple-clpc-policy)

Host tests / checks (23cd587389ae):
  python3 tools/asahi/clpc-gpu-demand-tests.py -> PASS (all positive + 44 negative controls)
  make ARCH=arm64 LLVM=1 CHECK_DTBS=y apple/t6050-{j716c,j775c,j714s,j775d}.dtb -> 0 CLPC/PMC warnings
  ./scripts/checkpatch.pl --strict -g HEAD~1..HEAD -> 0 errors, 0 warnings, 0 checks
  ./scripts/kernel-doc -none drivers/soc/apple/clpc.c -> 0 warnings

J716c runtime (main d3de772ac0c1 + 23cd587389ae + dc93841f2283, default cmdline):
  DT apple,gpu-busy-memory-states: (1, 2, 4, 6, 0, 0, 0, 3)
  PMC debugfs idle (before & after): agent1 floor: 0x00000000 honoured: 0x00000000
  PMC debugfs under CP2077 T2 load:  agent1 floor: 0x00000036 honoured: 0x00000036
  CP2077 2.5 T2: 55.38 FPS, 0 Asahi GPU faults, 0 pstate-1 clamps

Add gpu_max[APPLE_CLPC_RAILS] to struct apple_clpc_hw so T6050's DT
GPU busy-share ladder validates against DCS 6 / fabric 3 while keeping
the absent/malformed-DT fallback GPU floor and ANE ceiling at DCS 6 /
fabric 2, and update both T6050 GPU busy-share DT ladders
(t6050-die0.dtsi and t6050-j775c.dts) top column (>= 800 permille) from
fabric 2 to fabric 3.

Lower GPU busy columns stay at fabric 0 so idle and light compositing
behavior is unchanged; ANE demand stays at DCS 6 / fabric 2. Sustained
bandwidth-heavy GPU workloads on J716c (40-core M5 Max) gain +0.54 FPS
in Cyberpunk 2077 T2 with no GPU power-brake clamps.

Signed-off-by: Erik Bourget <erik@ebourget.net>
@erikwb
erikwb requested review from a team and DjDeveloperr as code owners December 2, 2026 20:39
@github-actions github-actions Bot added area:bringup Area from CODEOWNERS (bot) area:gpu Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) blast:m5 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown

Merge readiness at 23cd5873: not ready yet

Check Detail
CI at head running running: apple-build, dt-checks, host-tests, KUnit plan
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head no no line with the head SHA 23cd5873, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text ok Risk: two-way · T6050 boards (t6050-die0.dtsi and t6050-j775c.dts).

Areas: area:bringup, area:gpu, area:platform

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

@satchlj

satchlj commented Dec 2, 2026

Copy link
Copy Markdown
Member

Tested on Apple M5 Max (T6050, J775c, default command line) at exact head 23cd587389ae:

  • Host test: tools/asahi/clpc-gpu-demand-tests.py PASS (all positive cases and negative controls, including t6050-j775c.dts parity).
  • Boot & live DT: Clean native boot (7.3.0-1-61.3992-ARCH, 0 failed systemd units, 0 CLPC invalid-ladder or DT fallback warnings). Live /sys/firmware/devicetree/base/soc/power-management@286806000/performance-controller@1/apple,gpu-busy-memory-states reads (1, 2, 4, 6, 0, 0, 0, 3).
  • PMC / CLPC under saturated GPU load (gpubench-vk copy.bw d8 and llama-bench), pre- and post-suspend: host_gpu busy: 1000 permille (reported) level 3, reason_bits 0x3, agent1 floor: 0x00000036 honoured: 0x00000036, update errors: 0 across 19,384 samples. (Note: background boot-time CPU load held cpu=1 during the short idle windows of this boot, so pure reason_bits 0x2-only idle release was not isolated separately from 0x3 here.)
  • GPU & sleep checks:
    • gpubench-vk copy.bw d1/d4/d8: 167.0 / 277.8 / 278.6 GB/s (baseline main b3a5fda631b9: 168.3 / 278.1 / 279.2 GB/s).
    • gpubench-vk compute.heavy d1/d4/d8: 7,241 / 15,814 / 15,814 GFLOP/s (baseline: 7,112 / 15,788 / 15,797 GFLOP/s).
    • llama-bench (Llama-2-7B Q4_0, fa=1): pp128 2,928.44 ± 7.45, pp512 3,335.52 ± 18.30, tg32 120.83 ± 0.42 t/s.
    • dEQP-VK.api.smoke.*: 8/8 PASS pre- and post-resume.
    • 3/3 consecutive 15 s RTC s2idle cycles PASS (suspend_stats 0 -> 3, fail 0 -> 0).
    • 0 GPU faults, 0 kernel oops/warnings.

@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.

Approve, reviewed at 23cd587389ae.

  • gpu_max only raises the limit that DT ladder states are checked against. Every other SoC table leaves it at 0, so max(..., 0) changes nothing there. T6050's no-ladder floor (DCS 6 / fabric 2) and the ANE ceiling are unchanged, and the check still refuses fabric 4 and DCS 7.
  • The DT change reaches every T6050 board through t6050-die0.dtsi (J714c, J714s, J716c, J716s, J775d, J873s, K114c, K114s, K116c, K116s), plus the standalone J775c. All 11 built DTBs carry <1 2 4 6>, <0 0 0 3>.
  • M5 Pro boards: they use the same SoC table and the same CLPC and PMC path as the J775c row. Fabric 3 was the J714s GPU floor until ca3e298. That commit measured no package-power difference under GPU load, only a cost at idle. This ladder keeps fabric 0 below 800 permille, so the idle cost stays gone. I don't think a J714s row needs to hold the merge, but a J714s check in a later M5 slot is still worth doing.
  • Fabric 3 comes from our own measurements: our macOS trace has the PMP asking for it for fill, and the PMC honours 0x36 on J716c and J775c.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Local checks on 23cd587389ae merged into main d4b3c9a7ca8a (merge tree 3a80adbc25b3). Since then main has only added t8112-j473.dts, which nothing here uses. Run on an x86_64 build host, arm64 cross, LLVM=1, defconfig + asahi.config:

  • make W=1 drivers/soc/apple/clpc.o with KUNIT=y, which compiles the new KUnit case in: 0 warnings.
  • make W=1 CHECK_DTBS=y apple/t6050-*.dtb, all 11 DTBs: no warnings on the CLPC node, and every DTB carries the new ladder.
  • tools/asahi/run-host-tests.py --only clpc: 3/3 pass. clpc-gpu-demand-tests.py passes at head, at main and on the merge, with 47/47 negative controls each. Run against main's sources, the merge's version of the test fails at the T6050 fabric 3 ladder assertion, which is the expected result.
  • scripts/checkpatch.pl --strict -g 23cd587389ae: 0 errors, 0 warnings, 0 checks. scripts/kernel-doc -none drivers/soc/apple/clpc.c: clean.
  • KUnit: built here but not run, because this host has no QEMU. The author's 22/22 run stands.

Hosted CI is still queued. This merges on these local checks plus the J775c and J716c rows at this head.

@DjDeveloperr
DjDeveloperr merged commit b47fc63 into main Dec 2, 2026
7 of 12 checks passed
@DjDeveloperr
DjDeveloperr deleted the feat/clpc-t6050-gpu-fabric3 branch December 2, 2026 21:27
DjDeveloperr added a commit to m0d16l14n1/linux that referenced this pull request Dec 2, 2026
Conflicts and duplicates against aurora-silicon#3646, resolved to keep both sides:

- apple,pmc.yaml: main's low-power properties, then
  apple,low-power-smc-notice.
- t8142-j813-j815.dtsi: no textual conflict, but both sides add
  apple,smc to the CLPC node and dtc rejects the duplicate. Keep main's
  and add only apple,low-power-smc-notice.
- clpc-high-power-cleanup-tests.py: main's GPU cap case and
  apple_clpc_power_limited() handling, and the notice cases with the
  send_mode/SEQ switch.

drivers/soc/apple/clpc.c merges cleanly, with aurora-silicon#2856 and aurora-silicon#3992 in main.

Signed-off-by: DjDeveloperr <hey@djdev.me>
DjDeveloperr added a commit to m0d16l14n1/linux that referenced this pull request Dec 2, 2026
Conflicts with aurora-silicon#3868 and aurora-silicon#3992, resolved to keep both sides:

- apple,pmc.yaml and apple,clpc.yaml: apple,low-power-smc-notice, then
  apple,low-power-capacity-ceiling and apple,energy-monitor.
- t8142-j813-j815.dtsi: the notice, then the ceiling and the energy
  monitor on the CLPC node.
- clpc.c: KUnit only. Keep the T6050 GPU fabric case and the capacity
  ceiling and energy power cases.

The other files merge cleanly.

Signed-off-by: DjDeveloperr <hey@djdev.me>
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) area:gpu Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) blast:m5 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (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.

3 participants