Repository navigation
soc: apple: clpc: Take the Low Power mode ceiling from the DT (rebased on #2784) - #2816
Conversation
Let the boot loader pass the CPU frequency ceiling of macOS's Low Power mode, which the ADT has as pmgr/clpc cpu-low-power-frequency-max, on the performance controller node. The property keeps the ADT's unit (MHz), so the loader copies the value as it is. The name and text match the property proposed for the same ADT key on the M4 Pro and Max MacBook Pros. Signed-off-by: Nick <nekreshen@yandex.ru>
The ADT has macOS's Low Power mode CPU ceiling as pmgr/clpc cpu-low-power-frequency-max: 2220 MHz on the J704, J813 and J815 (M5), 2088 MHz on the J713 (M4 Air), 3144 MHz on the J700. The boot loader now copies it into the CLPC node as apple,low-power-frequency-max-mhz. Register the low-power platform profile wherever the node has that property, with its value as the ceiling. A node without it keeps the SoC's built-in value where there is one, so the T6041 and T8140 profiles stay as they are under an older loader. With the same ceiling built into the driver for the J815, low-power took its P cluster from 4464 to 2220 MHz and back (M5, 27.2 stub). Signed-off-by: Nick <nekreshen@yandex.ru> [Ryan: rebased onto the DT High Power mode change (68986f0, ef719df): the four places that read hw->low_power_khz for the profile (the profile and SMC gates, the policy notifier, the profile name and the idle-sampling decision) now read clpc->low_power_khz, so a DT-only ceiling registers as apple-clpc and keeps its ceiling; the host test model carries the new field.] Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
DjDeveloperr
left a comment
There was a problem hiding this comment.
Pre-PR Checklist Review (§1–§6) — 4e0335927443de39e3c14c101e10649afa80e50b
Clean rebase of #1906 onto #2784 (2b67c4e0). Approving on the code; wait for the in-progress dt-checks job to finish green before merging (all other 7/8 CI jobs — source, kunit, host-tests, rust-build, and all 3 DWC3/ATC matrix builds — are already passing, which explains the transient UNSTABLE state).
§1–§6 Audit
- §1 No model gating: PASS. Reads
apple,low-power-frequency-max-mhzfrom the CLPC DT node (populated from ADT by the bootloader) and preserves the existinghw->low_power_khzfallback when absent, matching the §1 chicken-and-egg rule. - §2 Production-ready, no hacks: PASS. Audited every
low_power_khzsite indrivers/soc/apple/clpc.cagainstintegration/aurora: all four sites introduced by #2784 (SMC parse gate, profile registration gate, cpufreq policy notifier gate,"apple-clpc"vs"apple-smc"profile name) plus the silent non-conflicting idle-sampling check inapple_clpc_sample(),apple_clpc_profile_limit(), andapple_clpc_status_show()now readclpc->low_power_khz.tools/asahi/clpc-gpu-demand-tests.pyis updated in lockstep to cover the runtime field. - §3 Safety: PASS. Ceiling comes from hardware ADT/DT; absent property falls back to existing table or 0 (profile off). Minor non-blocking note:
mhz * 1000inapple_clpc_probe()has no overflow guard if a malformed DT ever suppliedmhz > U32_MAX / 1000(not an issue for real ADT MHz values). - §4 Clean-room & attribution: PASS. Both commits preserve Nick's authorship and messages verbatim (
Signed-off-by: Nick <nekreshen@yandex.ru>), with a clear[Ryan: ...]rebase note aboveSigned-off-by: Ryan Murray <ryan@aurorasilicon.org>, zero AI trailers in commits, andAssisted-by:disclosure in the PR body. - §5 Evidence: PASS. Verified on J616s (MacBook Pro 16" M4 Pro, T6040, Fedora 45,
#2784#issuecomment-7080567187) with the exact same conflict resolution (only a checkpatch line wrap differs): registersapple-clpc(low-power balanced performance), holds P-cluster at 2868 MHz (8.70–8.78 W vs 4512 MHz / ~12.6–12.9 W), SMC High Power record toggles cleanly, 0 failed units, 0 AVCs, 0 kernel errors. Host tests, KUnit, andW=1clang build are clean. - §6 Naming: PASS.
Merge notes: Wait for dt-checks to complete green, ship alongside aurora-silicon/aurora-platform#35 for Fedora tuned-ppd wiring, and close superseded #1906 once merged.
Assisted-by: LLM (Gemini 4 Neon)
|
J616s (MacBook Pro 16" M4 Pro, T6040) row with this head (as 62688a9c + e8b6cccc cherry-picked onto the fleet81 candidate 4bf9f69d, which also carries #2784 and #2671; fleet config). Production Device Tree: the loader writes
With Fedora's shipped aurora-power-budget (0.1.13-5), tuned-ppd's Power Saver still leaves the class at Assisted-by: LLM (Claude:Opus 5.5) |
|
Review at 4e03359.
|
|
Merge-train adversarial review (MERGETRAIN-LINUX4) at 4e03359: no blockers. Merges clean on integration/aurora 00cbc67. Full reviewVERDICT: NO BLOCKERS Reviewed at head 4e03359 (commits e641792 binding, 4e03359 driver) on integration/aurora 00cbc67. The merge-base is bb9f8ec, and What was verified
BlockersNone. Nits
Missing rows (DT path unproven; proven only on J616s T6040, 2808 MHz -> 2868 MHz P cap, 8.80 W)
Assisted-by: LLM (Claude:Opus 5.5) |
This is #1906 by @m0d16l14n1, rebased onto integration/aurora now that #2784 (High Power mode from the DT) has landed. The two PRs conflict in
drivers/soc/apple/clpc.c, and the fork branch can only be updated by its author, so this carries Nick's two commits unchanged in authorship and message, with the conflict resolved in the second one (noted in brackets above the second sign-off).Problem. #1906 takes the Low Power mode CPU ceiling from
apple,low-power-frequency-max-mhzin the CLPC node (the loader copies it from the ADT), and falls back to the SoC table. #2784 added four new reads of the table valueclpc->hw->low_power_khz: the profile/SMC gates in probe, the cpufreq policy notifier, the profile name (apple-clpcvsapple-smc) and the idle-sampling decision. One of them (idle sampling) merges without a textual conflict and is still wrong. On a machine whose ceiling comes only from the DT (T6040: table value 0, loader writes 2808 MHz), the profile would register asapple-smc, never apply its ceiling, and sample deferrably in low-power.Change. All four reads use
clpc->low_power_khz(DT ceiling, else table, else 0). The host test model intools/asahi/clpc-gpu-demand-tests.pycarries the new field. One wrapped line for checkpatch. Otherwise identical to #1906 head 0cbf68d.Testing.
apple-clpcwithlow-power balanced performance; low-power holds the P cluster at 2868 MHz (first table step above 2808), 8.70-8.78 W on a one-thread P probe, vs 4512 MHz and about 12.6-12.9 W in balanced/performance; performance sends the SMC High Power record and balanced clears it. 0 failed units, 0 AVC, 0 kernel errors. Rows: soc: apple: clpc: take High Power mode from the device tree #2784 (comment)clpc-gpu-demand-tests.pyandclpc-high-power-cleanup-tests.pypass;W=1clang build ofclpc.oclean (arm64 fleet config); checkpatch clean.Still to run. Nothing on the J616s: this head booted there on the fleet81 candidate (row: #2816 (comment),
apple-clpcfrom the DT ceiling alone, low-power 2868 MHz at 8.80 W). On Fedora the low-power profile only reaches the class through aurora-silicon/aurora-platform#38, so a distro pin carrying this should ship together with it.Supersedes #1906 (credit and authorship stay with Nick).
Resolution (clpc.c, against integration/aurora)
The rest of the diff is #1906 as reviewed (DT property read in probe, the
profile:debugfs line,apple_clpc_profile_ceilings()), plus the binding commit unchanged.Assisted-by: LLM (Claude:Opus 5.5)