Re: [PATCH v3 2/2] cpufreq: CPPC: add autonomous mode boot parameter support

From: Sumit Gupta

Date: Mon May 18 2026 - 13:23:02 EST



On 18/05/26 19:51, Mario Limonciello wrote:
External email: Use caution opening links or attachments


On 5/18/26 09:15, Sumit Gupta wrote:

On 18/05/26 19:20, Mario Limonciello wrote:
External email: Use caution opening links or attachments


On 5/18/26 08:44, Sumit Gupta wrote:
Hi Mario,


On 16/05/26 02:43, Mario Limonciello wrote:
External email: Use caution opening links or attachments


On 5/15/26 07:26, Sumit Gupta wrote:
Add a kernel boot parameter 'cppc_cpufreq.auto_sel_mode' to enable
CPPC autonomous performance selection on all CPUs at system startup.
When autonomous mode is enabled, the hardware automatically adjusts
CPU performance based on workload demands using Energy Performance
Preference (EPP) hints.

When the parameter is set:
- Configure all CPUs for autonomous operation on first init
- Use HW min/max_perf when available; otherwise initialize from caps
- Initialize desired_perf to max_perf as a starting hint
- Hardware controls frequency instead of the OS governor
- EPP behavior depends on parameter value:
   - performance (or 1): override EPP to performance preference (0x0)
   - default_epp (or 2): preserve EPP value programmed by BIOS/
firmware

The boot parameter is applied only during first policy initialization.
Skip applying it on CPU hotplug to preserve runtime sysfs
configuration.

This patch depends on patch series [1] ("cpufreq: Set policy->min and
max as real QoS constraints") so that the policy->min/max set in
cppc_cpufreq_cpu_init() are not overridden by cpufreq_set_policy()
during init.

Signed-off-by: Sumit Gupta <sumitg@xxxxxxxxxx>
---
[1] https://lore.kernel.org/lkml/20260511135538.522653-1-
pierre.gondois@xxxxxxx/
---
  .../admin-guide/kernel-parameters.txt         |  16 +++
  drivers/cpufreq/cppc_cpufreq.c                | 122 +++++++++++++
++++-
  2 files changed, 133 insertions(+), 5 deletions(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/
Documentation/admin-guide/kernel-parameters.txt
index 0eb64aab3685..7e4b3a8fd76f 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -1048,6 +1048,22 @@ Kernel parameters
                      policy to use. This governor must be registered
in the
                      kernel before the cpufreq driver probes.

+     cppc_cpufreq.auto_sel_mode=
+                     [CPU_FREQ] Enable ACPI CPPC autonomous
performance
+                     selection. When enabled, hardware automatically
adjusts
+                     CPU frequency on all CPUs based on workload
demands.
+                     In Autonomous mode, Energy Performance
Preference (EPP)
+                     hints guide hardware toward performance (0x0)
or energy
+                     efficiency (0xff).
+                     Requires ACPI CPPC autonomous selection register
+                     support.
+                     Accepts:
+                       performance, 1: enable auto_sel + set EPP to
+                                       performance (0x0)
+                       default_epp, 2: enable auto_sel, preserve EPP
value
+                                       programmed by BIOS/firmware
+                     Unset: cpufreq governors are used (auto_sel
disabled).

Rather than unset doing nothing, have you considered having it take a
midpoint like 128?  That's what we do in amd-pstate (default to
balance_performance).  I think it turns into a reasonable balance.

Thanks for the suggestion.
I can add balance_performance that enables auto_sel with EPP=128 in v4.

On changing the driver default (no param behavior) to auto enable
balance_performance, it would be good to keep the current behavior for
now since cppc_cpufreq is generic across ARM64/RISC-V platforms where
EPP and Autonomous Selection registers are optional.
A default change would affect existing users relying on governors.

Thank you,
Sumit Gupta

But couldn't you make the "no module parameter set" follow the behavior
to only set the registers if they're available?

So the systems that support it start using it, the ones that don't it's
a NOP.


Would it work to add balance_performance as a new mode in v4,
and discuss changing the default separately as a follow-up?


Sure.

Runtime detection helps for unsupported platforms. But platforms which
support the registers use OS governors today, and silently switching
them to autonomous mode on a kernel update is a behavior change for
existing users. They would also have no way to boot into sw governor.


But hopefully it should be better battery life/responsiveness for those
scenarios too, right?


Yes in many cases, but if some workloads rely on specific OS governor
configurations, then that would get impacted.
I will send a separate change later to seek broader consensus on
enabling auto_sel as default without any param.

Thank you,
Sumit Gupta

....