[PATCH v2 1/2] cpufreq: CPPC: Don't warn if FIE init fails to read counters
Viresh Kumar
viresh.kumar at linaro.org
Mon Oct 27 22:10:35 PDT 2025
On 28-08-25, 19:02, Jie Zhan wrote:
> During the CPPC FIE initialization, reading perf counters on offline cpus
> should be expected to fail. Don't warn on this case.
>
> Also, change the error log level to debug since FIE is optional.
>
> Co-developed-by: Bowen Yu <yubowen8 at huawei.com>
> Signed-off-by: Bowen Yu <yubowen8 at huawei.com> # Changing loglevel to debug
> Signed-off-by: Jie Zhan <zhanjie9 at hisilicon.com>
> ---
> drivers/cpufreq/cppc_cpufreq.c | 12 +++---------
> 1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
> index 4a17162a392d..7724318b3415 100644
> --- a/drivers/cpufreq/cppc_cpufreq.c
> +++ b/drivers/cpufreq/cppc_cpufreq.c
> @@ -144,16 +144,10 @@ static void cppc_cpufreq_cpu_fie_init(struct cpufreq_policy *policy)
> init_irq_work(&cppc_fi->irq_work, cppc_irq_work);
>
> ret = cppc_get_perf_ctrs(cpu, &cppc_fi->prev_perf_fb_ctrs);
> - if (ret) {
> - pr_warn("%s: failed to read perf counters for cpu:%d: %d\n",
> + if (ret && cpu_online(cpu)) {
> + pr_debug("%s: failed to read perf counters for cpu:%d: %d\n",
> __func__, cpu, ret);
> -
> - /*
> - * Don't abort if the CPU was offline while the driver
> - * was getting registered.
> - */
> - if (cpu_online(cpu))
> - return;
> + return;
diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
index 7724318b3415..5a30c1ec0cdd 100644
--- a/drivers/cpufreq/cppc_cpufreq.c
+++ b/drivers/cpufreq/cppc_cpufreq.c
@@ -144,6 +144,11 @@ static void cppc_cpufreq_cpu_fie_init(struct cpufreq_policy *policy)
init_irq_work(&cppc_fi->irq_work, cppc_irq_work);
ret = cppc_get_perf_ctrs(cpu, &cppc_fi->prev_perf_fb_ctrs);
+
+ /*
+ * Don't abort as the CPU was offline while the driver was
+ * getting registered.
+ */
if (ret && cpu_online(cpu)) {
pr_debug("%s: failed to read perf counters for cpu:%d: %d\n",
__func__, cpu, ret);
Applied with this diff.
--
viresh
More information about the linux-arm-kernel
mailing list