cpufreq: Use the fixed and coherent frequency for scaling capacity
authorVincent Guittot <vincent.guittot@linaro.org>
Mon, 11 Dec 2023 10:48:50 +0000 (11:48 +0100)
committerIngo Molnar <mingo@kernel.org>
Sat, 23 Dec 2023 14:52:34 +0000 (15:52 +0100)
commit599457ba15403037b489fe536266a3d5f9efaed7
tree41c93eec91f6bc2d8a0432e80bd317db924f4f3e
parent9942cb22ea458c34fa17b73d143ea32d4df1caca
cpufreq: Use the fixed and coherent frequency for scaling capacity

cpuinfo.max_freq can change at runtime because of boost as an example. This
implies that the value could be different from the frequency that has been
used to compute the capacity of a CPU.

The new arch_scale_freq_ref() returns a fixed and coherent frequency
that can be used to compute the capacity for a given frequency.

[ Also fix a arch_set_freq_scale()  newline style wart in <linux/cpufreq.h>. ]

Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Lukasz Luba <lukasz.luba@arm.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Link: https://lore.kernel.org/r/20231211104855.558096-3-vincent.guittot@linaro.org
drivers/cpufreq/cpufreq.c
include/linux/cpufreq.h