]> www.infradead.org Git - users/jedix/linux-maple.git/commit
cpufreq/cppc: Don't compare desired_perf in target()
authorRiwen Lu <luriwen@kylinos.cn>
Wed, 12 Jun 2024 11:46:31 +0000 (19:46 +0800)
committerViresh Kumar <viresh.kumar@linaro.org>
Thu, 13 Jun 2024 09:42:57 +0000 (15:12 +0530)
commit90e4ed6bb02ad93663f17411d17e8e714a765a6b
tree08b63477173c2ff74055263683f0e4d3940a270d
parent3a1ac6b8f603a9310274990a0ad563a5fb709f59
cpufreq/cppc: Don't compare desired_perf in target()

There is a corner case where the desired_perf is exactly same as the old
perf, but the actual current freq is not.

This happens during 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 set to the lowest level (powersave
governor). This causes the warning: "CPU frequency out of sync:", and
the cpufreq core sets 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 same as the
cpu->perf_ctrls.desired_perf and both are the lowest_perf.

Since target_freq and policy->cur have been already compared in
__cpufreq_driver_target(), there's no need to compare them again here.

Drop the comparison.

Signed-off-by: Riwen Lu <luriwen@kylinos.cn>
[ Viresh: Updated commit message / subject ]
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/cppc_cpufreq.c