diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-06-27 21:29:29 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-06-27 21:29:29 -0400 |
commit | 742c87bf27d3b715820da6f8a81d6357adbf18f8 (patch) | |
tree | 31c96e9d4378c23b15a80a21f2f487fcd9bc62ce | |
parent | ca5eda5d3db6026080cff267459625c87c43e9ab (diff) |
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: 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>
Cc: 4.6+ <stable@vger.kernel.org> # 4.6+
-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 9009295f5134..5617c7087d77 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -2261,6 +2261,10 @@ int cpufreq_update_policy(unsigned int cpu) | |||
2261 | * -> ask driver for current freq and notify governors about a change | 2261 | * -> ask driver for current freq and notify governors about a change |
2262 | */ | 2262 | */ |
2263 | if (cpufreq_driver->get && !cpufreq_driver->setpolicy) { | 2263 | if (cpufreq_driver->get && !cpufreq_driver->setpolicy) { |
2264 | if (cpufreq_suspended) { | ||
2265 | ret = -EAGAIN; | ||
2266 | goto unlock; | ||
2267 | } | ||
2264 | new_policy.cur = cpufreq_update_current_freq(policy); | 2268 | new_policy.cur = cpufreq_update_current_freq(policy); |
2265 | if (WARN_ON(!new_policy.cur)) { | 2269 | if (WARN_ON(!new_policy.cur)) { |
2266 | ret = -EIO; | 2270 | ret = -EIO; |