Skip to content

soc: apple: clpc: hold P-cluster frequency floor for ANE on T8142 - #3009

Merged
RyanTheTide merged 1 commit into
aurora-silicon:integration/aurorafrom
niteria:t8142/clpc-ane-cluster-floor
Nov 23, 2026
Merged

RyanTheTide merged 1 commit into
aurora-silicon:integration/aurorafrom
niteria:t8142/clpc-ane-cluster-floor

Conversation

@niteria

@niteria niteria commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Once the T8142 engine AXI2AF bridge tunables (#3008) are applied, pure ANE execution time on T8142 still depends strongly on the P-cluster frequency (cpu-map cluster1), independent of which CPU cluster submits the request. Pinning submission to an E-core with the DCS 7 / SOC 3 floor active leaves unet-320 firmware report_done at 660.5 us (host p50 954.4 us) when no P-cluster floor is held.

Change

Thanks to @satchlj for independently confirming the same bridge-tunables plus CPU cluster hold split on T6050 (J775c).

Testing

  • Style: ./scripts/checkpatch.pl --strict --no-signoff -g origin/integration/aurora..HEAD — 0 errors, 0 warnings, 0 checks (25 lines checked).
  • Host tests: tools/asahi/run-host-tests.py --only clpc — 3/3 passed (clpc-gpu-demand-tests, clpc-high-power-cleanup-tests, --old-ref).
  • KUnit (x86_64, QEMU, KASAN+UBSAN): apple-clpc-gpu 11/11 passed (including updated apple_clpc_ane_cluster_test).
  • Hardware (J813, MacBook Air 13" M5, T8142, kernel 7.3.0-air-m5-anefix+ #1 SMP PREEMPT Mon Nov 23 19:54:47 CET 2026, NixOS 25.11.20260324.1073dad, SELinux N/A / disabled, 0 AVC denials, paired with accel/ane: T8142: apply engine bridge setup at power-up #3008):
    • P-cluster sweep pinned to E-core cpu2 (DCS 7 / SOC 3, unet-320 x 600 runs): report_done drops from 660.5 us (no floor) to 350.7 us at 4176 MHz (host p50 954.4 us -> 616.5 us, 4.49 W), with no further gain at 4464 MHz (363.0 us, 5.31 W).
    • Fabric A/B at 4176 MHz confirmed DCS 7 / SOC 3 remains optimal over 7 / 4.
    • Floor releases cleanly to idle (0x00000000, dcs 0, soc 0, policy0/1 min=300000, update errors: 0) within 1.5 s after ANE work completes; survives 30 s deep sleep/resume; 0 failed systemd units and 0 new CLPC/kernel errors.
P-cluster frequency/power sweep and fabric A/B on J813 (T8142)

Pinned to E-core cpu2, DCS 7 / SOC 3 floor active, unet-320 x 600 runs with #3008:

P-cluster floor delta_fw report_done Host p50 Avg package power
0 kHz (off) 760.4 us 660.5 us 954.4 us 2.44 W
3072 MHz 483.1 us 384.7 us 626.7 us 4.64 W
3516 MHz 477.8 us 378.7 us 664.9 us 4.55 W
3720 MHz 466.7 us 368.1 us 617.9 us 4.19 W
3876 MHz 462.1 us 362.4 us 615.8 us 4.14 W
4020 MHz 459.3 us 359.8 us 620.5 us 4.81 W
4176 MHz 450.0 us 350.7 us 616.5 us 4.49 W
4464 MHz 460.4 us 363.0 us 601.3 us 5.31 W

Fabric A/B at 4176 MHz (pinned cpu2):

  • unet-320: 7 3 622.4 us (mean 613.1 us) vs 7 4 613.2 us (mean 609.7 us)
  • mm-512x2048: 7 3 357.2 us vs 7 4 365.2 us
  • denoise-640: 7 3 4210.7 us vs 7 4 4257.0 us

Still to run

  • Verification on other T8142 boards (J815, J704).

Pre-PR checklist

  • No single-board gating; matches all T8142 machines via "apple,t8142".
  • checkpatch.pl --strict --no-signoff clean.
  • Host tests and KUnit (KASAN+UBSAN) passed.
  • Verified on hardware (J813, T8142) including frequency/power sweep, idle floor release, and deep sleep/resume.
  • Human Signed-off-by: applied and ready for review.

Assisted-by: LLM (Gemini 4 Neon)

Once the T8142 engine AXI2AF bridge tunables are applied, pure ANE
execution time on T8142 also depends on the P-cluster frequency (cpu-map
cluster1), independent of which CPU cluster submits the request.

Measured on J813 (MacBook Air 13" M5, T8142; J815 and J704 share the
compatible) pinned to an E-core with the DCS 7 / SOC 3 floor active,
unet-320 firmware report_done drops from 660.5 us with no P-cluster floor
to 350.7 us at 4176 MHz (host p50 954.4 us -> 616.5 us, 4.49 W average),
with no further reduction at 4464 MHz (363.0 us, 5.31 W).

Enable the existing CLPC ANE cluster frequency floor on apple_clpc_hw_t8142
for cluster 1 at 4176000 kHz, matching all T8142 machines via
"apple,t8142" as required by the current apple_clpc_probe() check (no
single-board gating; can move to apple,ane-cpu-opp once aurora-silicon#2856 lands).
Extend apple_clpc_ane_cluster_test accordingly.

Signed-off-by: Bartosz Nitka <niteria@gmail.com>
@niteria
niteria force-pushed the t8142/clpc-ane-cluster-floor branch from 962d6fa to b4ecd93 Compare November 23, 2026 20:18
@niteria
niteria marked this pull request as ready for review November 23, 2026 20:18

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

Formal §1–§6 pre-PR checklist review at b4ecd93a595e99af22609c42d3c3be398a4ab557 (APPROVE).

Technical & Checklist Audit (§1–§6)

  • §1 (No single-board gating): Enables .ane_cluster = 1, .ane_cluster_khz = 4176000, .ane_cluster_machine = "apple,t8142" on apple_clpc_hw_t8142, matching all T8142 boards (j813, j815, j704) as required by the current apple_clpc_probe() of_machine_is_compatible() check, with rationale explicitly documented in the commit message and a clear migration path to DT-driven apple,ane-cpu-opp once #2856 lands. On t8142-j704.dts (which does not yet define /cpus/cpu-map), apple_clpc_cluster_cpu(1) returns -ENODEV and cleanly no-ops until cpu-map is added.
  • §2–§3 (Correctness, bounds, lifetime, safety):
    • 4176000 kHz is a valid OPP in pcluster_opp across T8142 (opp-4176000000, level 14, below the 4464 MHz top OPP), and thermal / Low Power FREQ_QOS_MAX limits still override FREQ_QOS_MIN.
    • Reuses the existing apple_clpc_ane_cluster() path under sample_lock: lazy cpufreq_cpu_get()/cpufreq_cpu_put() (no pinned policy ref), CPUFREQ_REMOVE_POLICY cleanup in apple_clpc_policy_notify(), non-deferrable sampling while ane_qos_khz != 0 so the floor always drops after APPLE_CLPC_HOLD_MS, and guaranteed release in apple_clpc_halt() on suspend/remove. CONFIG_CPU_FREQ/CONFIG_PM/=m/=y buildability and non-T8142 SoCs are unaffected.
    • Interaction with #3006: Putting the ANE CPU cluster floor in clpc.c (and migrating to apple,ane-cpu-opp via #2856) is the right architecture: it holds the measured power-optimal knee OPP (4176 MHz, 4.49 W) rather than blindly pinning policy->cpuinfo.max_freq (4464 MHz, 5.31 W, no latency gain), and avoids duplicating freq_qos lifecycle management in ane_t6021. (Do not enable both #3009 and #3006 on the same SoC, or #3006's max_freq request will override CLPC's 4176 MHz knee.)
  • §4 & §6 (Clean-room, attribution, naming): Commit b4ecd93a595e carries human author/committer (Bartosz Nitka <niteria@gmail.com>) and human Signed-off-by: only (zero AI trailers); PR body carries Assisted-by:; clean-room measured frequency/power sweep; clean naming.
  • §5 (Evidence): Strong J813 hardware evidence: 8-point P-cluster frequency/power sweep pinned to E-core cpu2 (report_done 660.5 -> 350.7 us, host p50 954.4 -> 616.5 us, 4.49 W knee vs 4464 MHz 363.0 us / 5.31 W), fabric A/B confirming DCS 7 / SOC 3, clean idle release (0x00000000, policy0/1 min=300000, update errors: 0), 30 s deep sleep/resume survival, 0 failed systemd units, and 0 new CLPC/kernel errors.
  • Live CI: All 7/7 checks green (host-tests, source, rust-build, kunit including updated apple_clpc_ane_cluster_test, and 3× DWC3/ATC).

Non-blocking notes

  • For §5 completeness, please record the exact kernel/build ID and SELinux status (0 SELinux denials, or N/A if running a non-SELinux userspace) on the J813 run.
  • Note that the J813 sweep was measured paired with #3008 (which currently needs a DT-driven tunable respin); #3009 is safe standalone, though the full latency win depends on the companion bridge-tunable fix landing.

Assisted-by: LLM (Gemini 4 Neon)

@RyanTheTide
RyanTheTide merged commit 6f10822 into aurora-silicon:integration/aurora Nov 23, 2026
7 checks passed
@niteria

niteria commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Recording the §5 metadata for the J813 test run:

Updated the PR description to include these as well.

Assisted-by: LLM (Gemini 4 Neon)

@niteria
niteria deleted the t8142/clpc-ane-cluster-floor branch November 23, 2026 23:03
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