Re: [PATCH] cpufreq: CPPC: Support for autonomous selection in cppc_cpufreq
From: Viresh Kumar
Date: Mon May 19 2025 - 04:19:17 EST
On 07-05-25, 11:19, Lifeng Zheng wrote:
> Add sysfs interfaces for CPPC autonomous selection in the cppc_cpufreq
> driver.
>
> Signed-off-by: Lifeng Zheng <zhenglifeng1@xxxxxxxxxx>
Sumit, can you provide your tag if it looks fine to you ?
> diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu b/Documentation/ABI/testing/sysfs-devices-system-cpu
> index 206079d3bd5b..37065e1b8ebc 100644
> --- a/Documentation/ABI/testing/sysfs-devices-system-cpu
> +++ b/Documentation/ABI/testing/sysfs-devices-system-cpu
> @@ -268,6 +268,60 @@ Description: Discover CPUs in the same CPU frequency coordination domain
> This file is only present if the acpi-cpufreq or the cppc-cpufreq
> drivers are in use.
>
> +What: /sys/devices/system/cpu/cpuX/cpufreq/auto_select
Is the path correct? Should this be cpufreq/policyN/auto_select ?
> diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
> index b3d74f9adcf0..3c3d00cec298 100644
> --- a/drivers/cpufreq/cppc_cpufreq.c
> +++ b/drivers/cpufreq/cppc_cpufreq.c
> @@ -808,10 +808,119 @@ static ssize_t show_freqdomain_cpus(struct cpufreq_policy *policy, char *buf)
>
> return cpufreq_show_cpus(cpu_data->shared_cpu_map, buf);
> }
> +
> +static ssize_t show_auto_select(struct cpufreq_policy *policy, char *buf)
> +{
> + bool val;
> + int ret;
> +
> + ret = cppc_get_auto_sel(policy->cpu, &val);
> +
> + /* show "<unsupported>" when this register is not supported by cpc */
s/cpc/cppc/ ?
--
viresh