Skip to content

Commit cfdc589

Browse files
ionela-voinescurafaeljw
authored andcommitted
cppc_cpufreq: expose information on frequency domains
Use the existing sysfs attribute "freqdomain_cpus" to expose information to userspace about CPUs in the same frequency domain. Signed-off-by: Ionela Voinescu <ionela.voinescu@arm.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Tested-by: Mian Yousaf Kaukab <ykaukab@suse.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent bf76bb2 commit cfdc589

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

Documentation/ABI/testing/sysfs-devices-system-cpu

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@ Description: Discover CPUs in the same CPU frequency coordination domain
264264
attribute is useful for user space DVFS controllers to get better
265265
power/performance results for platforms using acpi-cpufreq.
266266

267-
This file is only present if the acpi-cpufreq driver is in use.
267+
This file is only present if the acpi-cpufreq or the cppc-cpufreq
268+
drivers are in use.
268269

269270

270271
What: /sys/devices/system/cpu/cpu*/cache/index3/cache_disable_{0,1}

drivers/cpufreq/cppc_cpufreq.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,19 @@ static int cppc_cpufreq_set_boost(struct cpufreq_policy *policy, int state)
402402
return 0;
403403
}
404404

405+
static ssize_t show_freqdomain_cpus(struct cpufreq_policy *policy, char *buf)
406+
{
407+
unsigned int cpu = policy->cpu;
408+
409+
return cpufreq_show_cpus(all_cpu_data[cpu]->shared_cpu_map, buf);
410+
}
411+
cpufreq_freq_attr_ro(freqdomain_cpus);
412+
413+
static struct freq_attr *cppc_cpufreq_attr[] = {
414+
&freqdomain_cpus,
415+
NULL,
416+
};
417+
405418
static struct cpufreq_driver cppc_cpufreq_driver = {
406419
.flags = CPUFREQ_CONST_LOOPS,
407420
.verify = cppc_verify_policy,
@@ -410,6 +423,7 @@ static struct cpufreq_driver cppc_cpufreq_driver = {
410423
.init = cppc_cpufreq_cpu_init,
411424
.stop_cpu = cppc_cpufreq_stop_cpu,
412425
.set_boost = cppc_cpufreq_set_boost,
426+
.attr = cppc_cpufreq_attr,
413427
.name = "cppc_cpufreq",
414428
};
415429

0 commit comments

Comments
 (0)