From: Hongye Lin <linhongye@h-partners.com> driver inclusion category: bugfix bugzilla: https://atomgit.com/openeuler/kernel/issues/9134 ---------------------------------------------------------------------- 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. Pengjie Zhang (1): cpufreq: Add debug print for current frequency in __cpufreq_driver_target() Qianfeng Rong (1): cpufreq: Use int type to store negative error codes Riwen Lu (1): cpufreq/cppc: Don't compare desired_perf in target() drivers/cpufreq/cppc_cpufreq.c | 9 ++------- drivers/cpufreq/cpufreq.c | 6 +++--- 2 files changed, 5 insertions(+), 10 deletions(-) -- 2.33.0