diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-06-28 03:29:29 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-10 12:54:46 +0200 |
commit | 4be5c33b5e44b3beb78100a94192e51d597e16a1 (patch) | |
tree | 4fba59d0428739243c6c901f7997f4522e83e9b6 | |
parent | 8b592e2ac932c3fa110fc820e9b2c1dc6b67df9c (diff) | |
download | lwn-4be5c33b5e44b3beb78100a94192e51d597e16a1.tar.gz lwn-4be5c33b5e44b3beb78100a94192e51d597e16a1.zip |
cpufreq: Avoid false-positive WARN_ON()s in cpufreq_update_policy()
commit 742c87bf27d3b715820da6f8a81d6357adbf18f8 upstream.
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: c9d9c929e674 (cpufreq: Abort cpufreq_update_current_freq() for cpufreq_suspended set)
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index c4acfc5273b3..e380457792ae 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -2169,6 +2169,10 @@ int cpufreq_update_policy(unsigned int cpu) * -> ask driver for current freq and notify governors about a change */ if (cpufreq_driver->get && !cpufreq_driver->setpolicy) { + if (cpufreq_suspended) { + ret = -EAGAIN; + goto unlock; + } new_policy.cur = cpufreq_update_current_freq(policy); if (WARN_ON(!new_policy.cur)) { ret = -EIO; |