From 8e2766c71f10b15832277950e318c835d8d27723 Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Tue, 17 Nov 2026 22:53:39 +1100 Subject: [PATCH 1/5] soc: apple: clpc: J616s: tell the SMC about High Power mode The 16-inch MacBook Pro with M4 Pro (J616s) has High Power mode on macOS. With it on, the SMC lets the fans run to their maximum under a sustained load: under a 300 s CPU and GPU load on macOS 27 the fans peak at about 3800 rpm in Automatic and about 5850 rpm in High Power, at the same CPU and GPU clocks, for 4-5% more sustained throughput and a GPU about 8 C cooler at the end of the run. Linux has no way to ask for it on this Mac: the CLPC registers its platform profile only where it has a low-power ceiling (the M4 Max), and the J616s CLPC node has no link to the SMC. Send the J714s High Power record on the J616s too: - give the T6040 data the J616s as its High Power machine; - register the platform profile on a machine that has High Power mode but no low-power ceiling, named "apple-smc", so that userspace keeps its own low-power CPU budget there (aurora-power-budget steps aside only for "apple-clpc"); - print the High Power state in debugfs outside the low-power block; - link the T604x CLPC to the SMC in the device tree, and say in the binding that the SMC also receives High Power mode. Not yet tested on hardware: the J616s needs a test kernel with a refreshed device tree to check that its SMC acts on the record. Co-Authored-By: Claude Opus 5.5 --- .../devicetree/bindings/power/apple,pmc.yaml | 3 +- arch/arm64/boot/dts/apple/t604x.dtsi | 2 + drivers/soc/apple/clpc.c | 42 +++++++++++++------ 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/Documentation/devicetree/bindings/power/apple,pmc.yaml b/Documentation/devicetree/bindings/power/apple,pmc.yaml index fe47291dff0dc..cec30fceef2e2 100644 --- a/Documentation/devicetree/bindings/power/apple,pmc.yaml +++ b/Documentation/devicetree/bindings/power/apple,pmc.yaml @@ -266,7 +266,8 @@ patternProperties: $ref: /schemas/types.yaml#/definitions/phandle description: The SMC, whose package power reading the low-power platform profile - holds the CPU clusters to. + holds the CPU clusters to, and which the performance profile tells + about High Power mode on Macs that have it. required: - compatible diff --git a/arch/arm64/boot/dts/apple/t604x.dtsi b/arch/arm64/boot/dts/apple/t604x.dtsi index 3484262fa7a43..dc9cd3dbd7a1b 100644 --- a/arch/arm64/boot/dts/apple/t604x.dtsi +++ b/arch/arm64/boot/dts/apple/t604x.dtsi @@ -1089,6 +1089,8 @@ clpc: performance-controller@1 { compatible = "apple,t6041-clpc"; reg = <1>; + /* High Power mode goes to the SMC (the 16-inch M4 Pro) */ + apple,smc = <&smc>; }; }; diff --git a/drivers/soc/apple/clpc.c b/drivers/soc/apple/clpc.c index bdf5331d3ff3a..4d22db8c39cc2 100644 --- a/drivers/soc/apple/clpc.c +++ b/drivers/soc/apple/clpc.c @@ -112,7 +112,9 @@ enum apple_clpc_rail { * holds the CPU clusters to; 0 for none * @high_power_machine: the machine compatible on which the performance * profile tells the SMC that macOS's High Power mode is on (the zETM - * record below); NULL for none + * record below); NULL for none. A machine with High Power mode and no + * low-power ceiling still gets the platform profile, named "apple-smc" + * so that userspace keeps its own low-power CPU budget */ struct apple_clpc_hw { unsigned int rail[APPLE_CLPC_RAILS]; @@ -1066,10 +1068,10 @@ static int apple_clpc_status_show(struct seq_file *s, void *unused) seq_printf(s, " cpu%u %u", clpc->clusters[i].policy_cpu, clpc->clusters[i].max_khz); seq_puts(s, "\n"); - if (clpc->high_power) - seq_printf(s, "smc high power: %s (%u records sent)\n", - clpc->high_power_sent ? "on" : "off", clpc->high_power_seq); } + if (clpc->high_power) + seq_printf(s, "smc high power: %s (%u records sent)\n", + clpc->high_power_sent ? "on" : "off", clpc->high_power_seq); if (clpc->gpu_pmgr) { seq_printf(s, "gpu: powered %u for %u ms, pmp limited ", clpc->gpu_on, clpc->gpu_on ? jiffies_to_msecs(jiffies - clpc->gpu_on_since) : 0); @@ -1355,6 +1357,7 @@ static int apple_clpc_probe(struct platform_device *pdev) struct device_node *gpu = NULL; struct apple_clpc *clpc; unsigned int rail, i; + bool high_power; int ret; clpc = devm_kzalloc(dev, sizeof(*clpc), GFP_KERNEL); @@ -1494,20 +1497,28 @@ static int apple_clpc_probe(struct platform_device *pdev) clpc->power_next = jiffies; if (!clpc->hw->low_power_machine || of_machine_is_compatible(clpc->hw->low_power_machine)) clpc->low_power_khz = clpc->hw->low_power_khz; - if (clpc->low_power_khz && IS_REACHABLE(CONFIG_ACPI_PLATFORM_PROFILE)) { - struct device *ppdev; - + high_power = clpc->hw->high_power_machine && + of_machine_is_compatible(clpc->hw->high_power_machine); + if ((clpc->low_power_khz || high_power) && IS_REACHABLE(CONFIG_ACPI_PLATFORM_PROFILE)) { /* The SMC is optional: without it the low-power profile has only its ceiling. */ clpc->smc_np = of_parse_phandle(dev->of_node, "apple,smc", 0); - clpc->high_power = clpc->smc_np && clpc->hw->high_power_machine && - of_machine_is_compatible(clpc->hw->high_power_machine); - if (!clpc->policy_nb_added) { + clpc->high_power = clpc->smc_np && high_power; + } + /* High Power mode alone needs the SMC; without it there is no profile. */ + if ((clpc->low_power_khz || clpc->high_power) && IS_REACHABLE(CONFIG_ACPI_PLATFORM_PROFILE)) { + struct device *ppdev; + + if (clpc->low_power_khz && !clpc->policy_nb_added) { clpc->policy_nb.notifier_call = apple_clpc_policy_notify; clpc->policy_nb_added = !cpufreq_register_notifier(&clpc->policy_nb, CPUFREQ_POLICY_NOTIFIER); } - ppdev = devm_platform_profile_register(dev, "apple-clpc", clpc, - &apple_clpc_profile_ops); + /* + * "apple-clpc" budgets the low-power profile itself; "apple-smc" + * only carries High Power mode, and userspace keeps the CPU budget. + */ + ppdev = devm_platform_profile_register(dev, clpc->low_power_khz ? "apple-clpc" : + "apple-smc", clpc, &apple_clpc_profile_ops); if (IS_ERR(ppdev)) dev_warn(dev, "no platform profile: %pe\n", ppdev); } @@ -1659,6 +1670,13 @@ static const struct apple_clpc_hw apple_clpc_hw_t6040 = { */ .low_power_khz = 2808000, .low_power_machine = "apple,t6041", + /* + * The 16-inch M4 Pro has High Power mode. Under a 300 s CPU and GPU + * load on macOS 27 its fans peak at 3800 rpm in Automatic and at + * 5850 rpm in High Power, with the same clocks; the extra cooling buys + * 4-5% sustained throughput. The record is the J714s one. + */ + .high_power_machine = "apple,j616s", }; /* From 5021a899a8d628387f7b5766a52ec4462548fa6f Mon Sep 17 00:00:00 2001 From: Ryan <81541646+RyanTheTide@users.noreply.github.com> Date: Thu, 19 Nov 2026 23:37:46 +1100 Subject: [PATCH 2/5] soc: apple: clpc: take High Power mode from the device tree Whether a Mac has High Power mode is a property of the board (the chassis and its cooling), not of the SoC. Until now the CLPC match data named one machine compatible per SoC that gets it, so every further board with High Power mode needed a driver change. Describe it in the board device tree instead: a boolean "apple,high-power-mode" on the CLPC node. The driver sends the zETM record when the property is present and the node links an SMC, and otherwise behaves as before. Set it on the J616s and the J714s, the two machines the match data named, and document it in the binding. Signed-off-by: Ryan --- .../devicetree/bindings/power/apple,pmc.yaml | 7 ++++++ arch/arm64/boot/dts/apple/t6040-j616s.dts | 5 ++++ arch/arm64/boot/dts/apple/t6050-j714s.dts | 5 ++++ drivers/soc/apple/clpc.c | 25 ++++++------------- 4 files changed, 25 insertions(+), 17 deletions(-) diff --git a/Documentation/devicetree/bindings/power/apple,pmc.yaml b/Documentation/devicetree/bindings/power/apple,pmc.yaml index cec30fceef2e2..4053aa0167d4d 100644 --- a/Documentation/devicetree/bindings/power/apple,pmc.yaml +++ b/Documentation/devicetree/bindings/power/apple,pmc.yaml @@ -269,6 +269,13 @@ patternProperties: holds the CPU clusters to, and which the performance profile tells about High Power mode on Macs that have it. + apple,high-power-mode: + type: boolean + description: + The machine has High Power mode, the fan and power headroom macOS + offers on some MacBook Pros. The performance platform profile then + tells the SMC (apple,smc) that it is on. + required: - compatible - reg diff --git a/arch/arm64/boot/dts/apple/t6040-j616s.dts b/arch/arm64/boot/dts/apple/t6040-j616s.dts index e81fb8b6b5d0d..1d9e600d6ffdb 100644 --- a/arch/arm64/boot/dts/apple/t6040-j616s.dts +++ b/arch/arm64/boot/dts/apple/t6040-j616s.dts @@ -40,6 +40,11 @@ }; }; +/* The 16-inch chassis has High Power mode */ +&clpc { + apple,high-power-mode; +}; + /* * ADT /arm-io/aon-ptd ptd_data_table: the battery record ("IFtb", layout 1, * slots 0x12-0x15). Only its peek aperture is read. diff --git a/arch/arm64/boot/dts/apple/t6050-j714s.dts b/arch/arm64/boot/dts/apple/t6050-j714s.dts index 383ec08bedbe2..4e67f77db52fc 100644 --- a/arch/arm64/boot/dts/apple/t6050-j714s.dts +++ b/arch/arm64/boot/dts/apple/t6050-j714s.dts @@ -491,6 +491,11 @@ apple,pmp = <&pmp0>; }; +/* The 14-inch M5 Pro has High Power mode */ +&clpc { + apple,high-power-mode; +}; + &sgx { power-domains = <&pmp0_gfx>; }; diff --git a/drivers/soc/apple/clpc.c b/drivers/soc/apple/clpc.c index 4d22db8c39cc2..081314a79ade9 100644 --- a/drivers/soc/apple/clpc.c +++ b/drivers/soc/apple/clpc.c @@ -110,11 +110,6 @@ enum apple_clpc_rail { * sharing this CLPC without it get no low-power profile. NULL for any * @low_power_mw: package power (the SMC's PHPC key) the low-power profile * holds the CPU clusters to; 0 for none - * @high_power_machine: the machine compatible on which the performance - * profile tells the SMC that macOS's High Power mode is on (the zETM - * record below); NULL for none. A machine with High Power mode and no - * low-power ceiling still gets the platform profile, named "apple-smc" - * so that userspace keeps its own low-power CPU budget */ struct apple_clpc_hw { unsigned int rail[APPLE_CLPC_RAILS]; @@ -135,7 +130,6 @@ struct apple_clpc_hw { unsigned int low_power_khz; const char *low_power_machine; unsigned int low_power_mw; - const char *high_power_machine; }; struct apple_clpc_cluster { @@ -1497,8 +1491,14 @@ static int apple_clpc_probe(struct platform_device *pdev) clpc->power_next = jiffies; if (!clpc->hw->low_power_machine || of_machine_is_compatible(clpc->hw->low_power_machine)) clpc->low_power_khz = clpc->hw->low_power_khz; - high_power = clpc->hw->high_power_machine && - of_machine_is_compatible(clpc->hw->high_power_machine); + /* + * The board DT says whether the machine has High Power mode: then the + * performance profile tells the SMC that it is on (the zETM record). + * A machine with High Power mode and no low-power ceiling still gets + * the platform profile, named "apple-smc" so that userspace keeps its + * own low-power CPU budget. + */ + high_power = of_property_read_bool(dev->of_node, "apple,high-power-mode"); if ((clpc->low_power_khz || high_power) && IS_REACHABLE(CONFIG_ACPI_PLATFORM_PROFILE)) { /* The SMC is optional: without it the low-power profile has only its ceiling. */ clpc->smc_np = of_parse_phandle(dev->of_node, "apple,smc", 0); @@ -1670,13 +1670,6 @@ static const struct apple_clpc_hw apple_clpc_hw_t6040 = { */ .low_power_khz = 2808000, .low_power_machine = "apple,t6041", - /* - * The 16-inch M4 Pro has High Power mode. Under a 300 s CPU and GPU - * load on macOS 27 its fans peak at 3800 rpm in Automatic and at - * 5850 rpm in High Power, with the same clocks; the extra cooling buys - * 4-5% sustained throughput. The record is the J714s one. - */ - .high_power_machine = "apple,j616s", }; /* @@ -2052,8 +2045,6 @@ static const struct apple_clpc_hw apple_clpc_hw_t6050 = { .idle_on_time = true, .low_power_khz = 2808000, .low_power_mw = 15000, - /* High Power mode's record, as macOS 27.0 writes it on the 14-inch M5 Pro */ - .high_power_machine = "apple,j714s", }; static const struct of_device_id apple_clpc_of_match[] = { From efbfe01041ae52d5ac497f5f908be9d4e4f2c229 Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Fri, 20 Nov 2026 18:14:54 +1100 Subject: [PATCH 3/5] tools/asahi: clpc-high-power-cleanup-tests: match any platform profile name The CLPC now names its platform profile "apple-clpc" or "apple-smc" depending on whether the machine has a low-power ceiling, so the call is no longer written with a literal "apple-clpc". Look for the devm_platform_profile_register() call itself when checking that the stop action is registered before the profile. The pre-fix reference still matches. Signed-off-by: Ryan Murray --- tools/asahi/clpc-high-power-cleanup-tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/asahi/clpc-high-power-cleanup-tests.py b/tools/asahi/clpc-high-power-cleanup-tests.py index 806d309a4c1bc..709aed09ecf4f 100755 --- a/tools/asahi/clpc-high-power-cleanup-tests.py +++ b/tools/asahi/clpc-high-power-cleanup-tests.py @@ -231,7 +231,7 @@ def main(): cwd=ROOT, text=True) if args.old_ref else (ROOT / DRIVER).read_text()) # This is the action whose callback runs after devres removes the profile. assert source.index('devm_add_action_or_reset(dev, apple_clpc_stop, clpc)') < source.index( - 'devm_platform_profile_register(dev, "apple-clpc"') + 'devm_platform_profile_register(dev,') defines = '\n'.join(re.findall(r'^#define APPLE_CLPC_(?:ZETM_\w+|FLOAT_ONE)\s+[^\n]+', source, re.M)) body = '\n\n'.join(function(source, n) for n in ( 'apple_clpc_send_high_power', 'apple_clpc_profile_set', 'apple_clpc_halt', 'apple_clpc_stop')) From c5ab4e3996de8587335522428898797a4b7111b4 Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Sat, 21 Nov 2026 10:29:13 +1100 Subject: [PATCH 4/5] soc: apple: clpc: keep sampling deferrable in low power with no ceiling With a profile that has High Power but no low-power ceiling (J616s), choosing low-power sets clpc->low_power, and the sample loop then queues its 4 ms sample as non-deferrable. apple_clpc_profile_limit() returns at once when low_power_khz is 0, so those ~250 wakeups/s do nothing and cost idle power in the mode users pick for battery. Sample on time in low power only when there is a low-power ceiling to keep. Signed-off-by: Ryan Murray --- drivers/soc/apple/clpc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/soc/apple/clpc.c b/drivers/soc/apple/clpc.c index 42e60d0e96926..f00f35181aa68 100644 --- a/drivers/soc/apple/clpc.c +++ b/drivers/soc/apple/clpc.c @@ -988,9 +988,15 @@ static void apple_clpc_sample(struct apple_clpc *clpc) apple_clpc_profile_limit(clpc); - /* Sample on time while graphics is powered, to see it power off, and in low power. */ + /* + * Sample on time while graphics is powered, to see it power off, and in + * low power where it has a ceiling to keep. A profile with no low-power + * ceiling (High Power only) has nothing to do there, so it stays + * deferrable. + */ apple_clpc_queue(clpc, !apple_clpc_floor(clpc, state) && !clpc->gpu_on && - !clpc->ane_qos_khz && !READ_ONCE(clpc->low_power)); + !clpc->ane_qos_khz && + !(clpc->low_power_khz && READ_ONCE(clpc->low_power))); } static void apple_clpc_run(struct apple_clpc *clpc) From 278c377e1395ea8ed811473d6260dda94d70daa5 Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Sat, 21 Nov 2026 11:05:43 +1100 Subject: [PATCH 5/5] tools/asahi: clpc-gpu-demand-tests: cover low power without a CPU ceiling The harness stub of struct apple_clpc lacked low_power_khz, which the sample loop now reads, so the test no longer compiled. Add the field and a case: idle in low power with no ceiling (High Power only) samples deferrably, with a ceiling on time, and balanced deferrably again. Signed-off-by: Ryan Murray --- tools/asahi/clpc-gpu-demand-tests.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tools/asahi/clpc-gpu-demand-tests.py b/tools/asahi/clpc-gpu-demand-tests.py index 2e852e6f91643..43ad90e32b42d 100644 --- a/tools/asahi/clpc-gpu-demand-tests.py +++ b/tools/asahi/clpc-gpu-demand-tests.py @@ -111,6 +111,7 @@ def main(): unsigned int ane_qos_khz; unsigned long ane_until; bool low_power; + unsigned int low_power_khz; }; static unsigned long jiffies; static u64 ktime_get_mono_fast_ns(void) { return jiffies * 1000000ull; } @@ -245,6 +246,19 @@ def main(): assert(c.last_reason==16); } +// Low power samples on time only where it has a CPU ceiling to keep +// (low_power_khz); a High Power-only profile stays deferrable when idle. +static void check_low_power(void) { + struct apple_clpc_gpu gpu={0}; + struct apple_clpc c={.hw=&apple_clpc_hw_t6040,.agent=1,.mask=3,.gpu=&gpu,.low_power=true}; + read_error=vote_error=0; pmgr_status=0xf0; published=~0u; + jiffies=3000; apple_clpc_sample(&c); assert(published==0 && queued_idle); + c.low_power_khz=2808000; + jiffies=3004; apple_clpc_sample(&c); assert(published==0 && !queued_idle); + c.low_power=false; + jiffies=3008; apple_clpc_sample(&c); assert(published==0 && queued_idle); +} + int main(void) { // T6040's supplier is always powered: it must NEVER substitute for work. struct apple_clpc_gpu gpu={0}; @@ -273,6 +287,7 @@ def main(): check_t8140(); check_t8140_dense(); check_t8140_ane(); + check_low_power(); check_t6040_ane(); puts("PASS: T6040 and T8132 host demand; T8140 ANE, streaming, dense work, read errors and PMP backoff; idle release"); }