Re: [PATCH v4] cpufreq/cppc: Remove the desired_perf compare when set target

From: Viresh Kumar
Date: Thu Jun 13 2024 - 05:42:57 EST


On 12-06-24, 19:46, Riwen Lu wrote:
> From: Riwen Lu <luriwen@xxxxxxxxxx>
>
> There is a case that desired_perf is exactly the same with the old perf,
> but the actual current freq is not.
>
> This happened in S3 while the cpufreq governor is set to powersave.
> During cpufreq resume process, the booting CPU's new_freq obtained via
> .get() is the highest frequency, while the policy->cur and
> cpu->perf_ctrls.desired_perf are in the lowest level(powersave
> governor). Causing the warning: "CPU frequency out of sync:", and set
> policy->cur to new_freq.
>
> Then the governor->limits() calls cppc_cpufreq_set_target() to
> configures the CPU frequency and returns directly because the
> desired_perf converted from target_freq is the same with
> cpu->perf_ctrls.desired_perf and both are the lowest_perf.
>
> Since target_freq and policy->cur have been compared in
> __cpufreq_driver_target(), there's no need to compare desired_perf and
> cpu->perf_ctrls.desired_perf again in cppc_cpufreq_set_target() to
> ensure that the CPU frequency is properly configured.
>
> Signed-off-by: Riwen Lu <luriwen@xxxxxxxxxx>

Applied. Thanks.

--
viresh