Re: [PATCH v2 7/7] cpufreq: CPPC: add autonomous mode boot parameter support

From: Randy Dunlap
Date: Sat Aug 23 2025 - 20:08:44 EST




On 8/23/25 1:01 PM, Sumit Gupta wrote:
> Add kernel boot parameter 'cppc_cpufreq.auto_sel_mode' to enable CPPC
> autonomous performance selection at system startup. When autonomous mode
> is enabled, the hardware automatically adjusts CPU performance based on
> workload demands using Energy Performance Preference (EPP) hints from
> the OS.
>
> This parameter allows to configure the autonomous mode on all CPUs
> without requiring runtime sysfs manipulation if the 'auto_sel' register
> is present.
>
> When auto_sel_mode=1:
> - All CPUs are configured for autonomous operation during driver init
> - EPP is set to performance preference (0x0) by default
> - Min/max performance bounds use defaults
> - CPU frequency scaling is handled by hardware rather than OS
>
> Also ensure that when autonomous mode is active, the set_target callback
> returns early since hardware controls frequency scaling directly.
>
> Signed-off-by: Sumit Gupta <sumitg@xxxxxxxxxx>



> ---
> .../admin-guide/kernel-parameters.txt | 12 ++
> drivers/cpufreq/cppc_cpufreq.c | 171 ++++++++++++++++--
> 2 files changed, 168 insertions(+), 15 deletions(-)
>
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index 86f395f2933b..ea58deb88c36 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -911,6 +911,18 @@
> Format:
> <first_slot>,<last_slot>,<port>,<enum_bit>[,<debug>]
>
> + cppc_cpufreq.auto_sel_mode=
> + [CPU_FREQ] Autonomous Performance Level Selection.
> + When Autonomous selection is enabled, then the hardware is
> + allowed to autonomously select the CPU frequency.
> + In Autonomous mode, Energy Performance Preference(EPP)
> + provides input to the hardware to favour performance (0x0)
> + or energy efficiency (0xff).
> + Format: <bool>
> + Default: disabled.
> + 0: force disabled
> + 1: force enabled
> +
> cpuidle.off=1 [CPU_IDLE]
> disable the cpuidle sub-system
>
> diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
> index 5e1bbb5f67b8..bbf654c56ff9 100644
> --- a/drivers/cpufreq/cppc_cpufreq.c
> +++ b/drivers/cpufreq/cppc_cpufreq.c

[snip]

>
> +module_param(auto_sel_mode, bool, 0000);

Hm. Is this changed to readable at some point or
does it stay invisible?

> +MODULE_PARM_DESC(auto_sel_mode, "Enable Autonomous Performance Level Selection");
> +
> module_exit(cppc_cpufreq_exit);
> MODULE_AUTHOR("Ashwin Chaugule");
> MODULE_DESCRIPTION("CPUFreq driver based on the ACPI CPPC v5.0+ spec");

For Documentation/:
Reviewed-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>

Thanks.

--
~Randy