Skip to content

Commit 742c87b

Browse files
committed
cpufreq: Avoid false-positive WARN_ON()s in cpufreq_update_policy()
CPU notifications from the firmware coming in when cpufreq is suspended cause cpufreq_update_current_freq() to return 0 which triggers the WARN_ON() in cpufreq_update_policy() for no reason. Avoid that by checking cpufreq_suspended before calling cpufreq_update_current_freq(). Fixes: c9d9c92 (cpufreq: Abort cpufreq_update_current_freq() for cpufreq_suspended set) Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Viresh Kumar <[email protected]> Cc: 4.6+ <[email protected]> # 4.6+
1 parent ca5eda5 commit 742c87b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/cpufreq/cpufreq.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2261,6 +2261,10 @@ int cpufreq_update_policy(unsigned int cpu)
22612261
* -> ask driver for current freq and notify governors about a change
22622262
*/
22632263
if (cpufreq_driver->get && !cpufreq_driver->setpolicy) {
2264+
if (cpufreq_suspended) {
2265+
ret = -EAGAIN;
2266+
goto unlock;
2267+
}
22642268
new_policy.cur = cpufreq_update_current_freq(policy);
22652269
if (WARN_ON(!new_policy.cur)) {
22662270
ret = -EIO;

0 commit comments

Comments
 (0)