lkml.org 
[lkml]   [2016]   [Apr]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] cpufreq: Skip all governor-related actions for cpufreq_suspended set
Date
From: Rafael J. Wysocki <rafael.j.wysocki@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.wysocki@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);
}
\
 
 \ /
  Last update: 2016-04-07 03:41    [W:0.131 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site