From: Rafael J. Wysocki <rafael.j.wyso...@intel.com>

Since governor operations are generally skipped if cpufreq_suspended
is set, do nothing at all in cpufreq_start_governor() and
cpufreq_exit_governor() in that case.

In particular, this prevents fast frequency switching from being
disabled after a suspend-to-RAM cycle on all CPUs except for the
boot one.

Fixes: b7898fda5bc7 (cpufreq: Support for fast frequency switching)
Signed-off-by: Rafael J. Wysocki <rafael.j.wyso...@intel.com>
---
 drivers/cpufreq/cpufreq.c |    6 ++++++
 1 file changed, 6 insertions(+)

Index: linux-pm/drivers/cpufreq/cpufreq.c
===================================================================
--- linux-pm.orig/drivers/cpufreq/cpufreq.c
+++ linux-pm/drivers/cpufreq/cpufreq.c
@@ -2053,6 +2053,9 @@ static int cpufreq_start_governor(struct
 {
        int ret;
 
+       if (cpufreq_suspended)
+               return 0;
+
        if (cpufreq_driver->get && !cpufreq_driver->setpolicy)
                cpufreq_update_current_freq(policy);
 
@@ -2062,6 +2065,9 @@ static int cpufreq_start_governor(struct
 
 static int cpufreq_exit_governor(struct cpufreq_policy *policy)
 {
+       if (cpufreq_suspended)
+               return 0;
+
        cpufreq_disable_fast_switch(policy);
        return cpufreq_governor(policy, CPUFREQ_GOV_POLICY_EXIT);
 }

Reply via email to