Re: [PATCH] cpufreq: CPPC: Support for autonomous selection in cppc_cpufreq

From: zhenglifeng (A)
Date: Mon May 19 2025 - 05:42:42 EST


On 2025/5/19 16:18, Viresh Kumar wrote:
> 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 ?

cpufreq/policyN/ is linked to cpuX/cpufreq/, both paths correct. The
description of freqdomain_cpus uses cpuX/cpufreq/, so I followed.

>
>> 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/ ?

It means Continuous Performance Control, you can see that in ACPI 6.5,
s8.4.6.1 _CPC (Continuous Performance Control). Use "_CPC" might be better.