Skip to content

soc: apple: clpc: step T8132 CPU memory floor and require busy streak - #3545

Merged
RyanTheTide merged 1 commit into
mainfrom
feat/t8132-clpc-cpu-ladder
Nov 29, 2026
Merged

RyanTheTide merged 1 commit into
mainfrom
feat/t8132-clpc-cpu-ladder

Conversation

@erikwb

@erikwb erikwb commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

What: Replace the flat {5, 5, 5, 5} / {3, 3, 3, 3} (sustain = 0) T8132 CPU CLPC table with a stepped frequency-quartile ladder ({1, 2, 4, 5} DCS, {0, 0, 1, 3} fabric) and a 3-sample (12 ms) busy streak matching T6040, so low-clocked E-core activity and brief interactive bursts stop pinning top DCS 5 / fabric 3 voltage states while peak CPU and GPU workloads keep full bandwidth.
Tested: J713 M4 Air at 047f6b5e17c2 (unchanged patch on J713 trial build, default command line): boots cleanly, 0 failed units, 0 new kernel errors; same-machine A/B saves -586 mW PSTR on 30% P-core bursts (floor 0x35 37/50 → 0/50), -503 mW 3.8 V rail on 65% E-core @ 900 MHz (floor 0x35 50/50 → 0/50), cuts 1080p60 AVD video 0x35 spikes 64% → 5%, with sustained 4-thread membw at 96.51 GB/s (baseline 95.26 GB/s, no regression).
Risk: two-way door · M4 (T8132) Macs
Not yet: Other T8132 boards (J604, J623, J624, J715, J773g) have not been run on hardware yet; when combined with #3491, t8132_from_dt() in tools/asahi/clpc-gpu-demand-tests.py needs its expected CPU map updated from flat to stepped.

Details

Previously, apple_clpc_hw_t8132 mapped every CPU frequency quartile to DCS 5 / fabric 3 with .sustain = 0. Any single 4 ms sample above 50% busy on either cluster raised both memory and fabric rails to their maximum states for at least APPLE_CLPC_HOLD_MS (32 ms). On J713, a single E-core at 900 MHz draws ~9 mW on PPbb while the resulting 0x35 floor added ~630–775 mW of system power.

This change:

  1. Steps apple_clpc_hw_t8132.map across the four frequency quartiles:
    • q = 0 (< 25% max, P 912 MHz): DCS 1 / fabric 0
    • q = 1 (25–49%, E 900–1080 MHz, P 1260–2088 MHz): DCS 2 / fabric 0
    • q = 2 (50–74%, E 1476–1860 MHz, P 2352–3300 MHz): DCS 4 / fabric 1
    • q = 3 (>= 75%, E 2172–2892 MHz, P 3468–4464 MHz): DCS 5 / fabric 3
  2. Sets .sustain = 3 (three consecutive busy samples, 12 ms), matching apple_clpc_hw_t6040 and apple_clpc_hw_t6050 so brief background and interactive bursts do not trigger memory rail ramps.
  3. Leaves top-quartile CPU demand and host-reported GPU demand (when no DT busy-share ladder is present) at DCS 5 / fabric 3.
  4. Updates the KUnit assertions in drivers/soc/apple/clpc.c and check_t8132() in tools/asahi/clpc-gpu-demand-tests.py.
Evidence

Host checks (047f6b5e17c2)

  • python3 tools/asahi/clpc-gpu-demand-tests.py: PASS (all positive cases and negative controls)
  • python3 tools/asahi/clpc-high-power-cleanup-tests.py: PASS
  • ./scripts/checkpatch.pl --no-tree: 0 errors, 0 warnings

J713 M4 Air same-machine A/B (default command line)

Workload Baseline (flat M5/F3, sustain=0) With 047f6b5e17c2 (stepped + sustain=3) Delta
1 P-core 30% burst (6/20 ms) PSTR +875 mW over idle (0x35 47/50) PSTR +289 mW over idle (0x00 48/50) -586 mW PSTR
1 E-core @ 900 MHz, 65% busy 3.8 V +630 mW over idle (0x35 50/50) 3.8 V +127 mW over idle (0x00 44/50, 0x02 4/50) -503 mW 3.8 V
1 E-core 20% burst (4/20 ms) 0x35 38/50 (+559 mW 3.8 V over idle) 0x00 47/50 (+24 mW 3.8 V over idle) -535 mW 3.8 V
1080p60 AVD video (with #3491) 0x35 48/75 (64%) 0x02 55/60 (92%), 0x35 3/60 (5%) CPU SoC 3 spikes eliminated
membw 1-thread (40×64 MB) 52.60 GB/s 54.11 GB/s +2.9%
membw 4-thread sustained (120×64 MB) 95.26 GB/s 96.51 GB/s +1.3%

Boot regression check on J713: renderD128 present, 0 failed systemd units, 9 error-level dmesg lines (identical to baseline).

T8132 currently votes top DCS 5 / fabric 3 on the very first busy CPU
sample at any frequency, including a single low-clocked E-core or brief
interactive bursts. On J713, a single E-core at 900 MHz draws 9 mW on
its own rail while holding DCS 5 / fabric 3 adds ~630-775 mW of system
power.

Replace the flat {5, 5, 5, 5} / {3, 3, 3, 3} T8132 CPU table with a
stepped quartile ladder ({1, 2, 4, 5} DCS, {0, 0, 1, 3} fabric) and a
three-sample (12 ms) busy streak, matching the T6040 streak filter.
Top-quartile CPU work and GPU demand still request DCS 5 / fabric 3.

Signed-off-by: Erik Bourget <erik@ebourget.net>
@erikwb
erikwb requested review from a team and DjDeveloperr as code owners November 28, 2026 16:08

@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 047f6b5e

Blockers: none (wait for the queued CI checks at 047f6b5e to finish green before merging; note that if combined with #3491, t8132_from_dt() in tools/asahi/clpc-gpu-demand-tests.py will need its expected CPU map updated).

Checked:

  • drivers/soc/apple/clpc.c: replaces the flat {5, 5, 5, 5} / {3, 3, 3, 3} (sustain = 0) T8132 CPU table with a stepped quartile ladder ({1, 2, 4, 5} DCS, {0, 0, 1, 3} fabric) and .sustain = 3 (12 ms), matching T6040/T6050.
  • Verified apple_clpc_gpu_input_demand() reads hw->map[rail][APPLE_CLPC_LEVELS - 1] (5 DCS / 3 fabric), so host-reported GPU floor behavior is unchanged when no DT busy-share ladder is present.
  • KUnit (apple_clpc_t8132_gpu_input_test) and tools/asahi/clpc-gpu-demand-tests.py (check_t8132) both updated to assert the stepped map and sustain == 3; both host CLPC suites and checkpatch.pl pass cleanly.
  • Exact-head J713 M4 Air same-machine A/B at 047f6b5e17c2 saves -586 mW PSTR on 30% P-core bursts, -503 mW on 3.8 V rail at 65% E-core 900 MHz, cuts 1080p60 AVD 0x35 spikes 64% -> 5%, with no membw regression (96.51 vs 95.26 GB/s) and 0 failed units.
  • Checked for Apple material, tool attribution, and private serials: clean; MERGEABLE on main; human Signed-off-by; Tested: and Risk: two-way door present.
Evidence
  • Head: 047f6b5e (base: main, mergeable: MERGEABLE, +28/-8 across 2 files).
  • Inspected drivers/soc/apple/clpc.c (apple_clpc_hw_t8132, apple_clpc_gpu_input_demand, apple_clpc_t8132_gpu_input_test) and tools/asahi/clpc-gpu-demand-tests.py.
  • Hosted CI at 047f6b5e is currently queued.

@RyanTheTide

Copy link
Copy Markdown
Contributor

code-owner ping <@422957901716652033> / @DjDeveloperr: merge train at 047f6b5e. App approved (NEON-PR-REVIEW2). J713 exact-head A/B PASS; T8132-only, selected from the DT. Check: #3491's t8132_from_dt() test needs a rebase if both land. Merges under the 6-point rule after that and green CI, unless you object.

@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) blast:m4 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) labels Nov 28, 2026
@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Merge readiness at 047f6b5e: not ready yet

Check Detail
CI at head running running: KUnit macsmc, KUnit clpc, KUnit apple-spmi-nvmem, KUnit trusted-keys
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok in the PR body at 047f6b5e
Conflicts ok none
PR text ok Risk: two-way · M4 (T8132) Macs

Areas: area:gpu, area:platform

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

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merging under the 6-point rule (Ryan 09:29, permanent), at 047f6b5e. (1) The review App approved at this head. (2) Full CI is green. (3/4) Rows: J713;T8132-DT-selected. (5) There's no blocking review. (6) Dj was pinged here 541 min ago with no objection. Revert: git revert -m 1 <merge>.

@RyanTheTide
RyanTheTide merged commit d2532e9 into main Nov 29, 2026
26 of 27 checks passed
@RyanTheTide
RyanTheTide deleted the feat/t8132-clpc-cpu-ladder branch November 29, 2026 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:gpu Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) blast:m4 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.

2 participants