[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250730063930.cercfcpjwnfbnskj@vireshk-i7>
Date: Wed, 30 Jul 2025 12:09:30 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Bowen Yu <yubowen8@...wei.com>
Cc: rafael@...nel.org, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org, linuxarm@...wei.com,
jonathan.cameron@...wei.com, zhanjie9@...ilicon.com,
lihuisong@...wei.com, zhenglifeng1@...wei.com,
Prashant Malani <pmalani@...gle.com>,
Beata Michalska <beata.michalska@....com>,
Ionela Voinescu <ionela.voinescu@....com>
Subject: Re: [PATCH 2/2] cpufreq: CPPC: Fix error handling in
cppc_scale_freq_workfn()
+ Prashant/Beata/Ionela
On 30-07-25, 11:23, Bowen Yu wrote:
> From: Jie Zhan <zhanjie9@...ilicon.com>
>
> Perf counters could be 0 if the cpu is in a low-power idle state. Just try
> it again next time and update the frequency scale when the cpu is active
> and perf counters successfully return.
>
> Also, remove the FIE source on an actual failure.
>
> Signed-off-by: Jie Zhan <zhanjie9@...ilicon.com>
> ---
> drivers/cpufreq/cppc_cpufreq.c | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
> index 904006027df2..e95844d3d366 100644
> --- a/drivers/cpufreq/cppc_cpufreq.c
> +++ b/drivers/cpufreq/cppc_cpufreq.c
> @@ -78,12 +78,23 @@ static void cppc_scale_freq_workfn(struct kthread_work *work)
> struct cppc_cpudata *cpu_data;
> unsigned long local_freq_scale;
> u64 perf;
> + int ret;
>
> cppc_fi = container_of(work, struct cppc_freq_invariance, work);
> cpu_data = cppc_fi->cpu_data;
>
> - if (cppc_get_perf_ctrs(cppc_fi->cpu, &fb_ctrs)) {
> + ret = cppc_get_perf_ctrs(cppc_fi->cpu, &fb_ctrs);
> + /*
> + * Perf counters could be 0 if the cpu is in a low-power idle state.
> + * Just try it again next time.
> + */
> + if (ret == -EFAULT)
> + return;
> +
> + if (ret) {
> pr_warn("%s: failed to read perf counters\n", __func__);
> + topology_clear_scale_freq_source(SCALE_FREQ_SOURCE_CPPC,
> + cpu_data->shared_cpu_map);
> return;
> }
>
> --
> 2.33.0
--
viresh
Powered by blists - more mailing lists