Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH] cpufreq: Skip all governor-related actions for cpufreq_suspended set
@ 2016-04-07  1:29 Rafael J. Wysocki
  2016-04-07  4:28 ` Viresh Kumar
  2016-04-08  5:45 ` Viresh Kumar
  0 siblings, 2 replies; 15+ messages in thread
From: Rafael J. Wysocki @ 2016-04-07  1:29 UTC (permalink / raw)
  To: Linux PM list
  Cc: Linux Kernel Mailing List, Viresh Kumar, Srinivas Pandruvada

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);
 }

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2016-04-10  4:10 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-07  1:29 [PATCH] cpufreq: Skip all governor-related actions for cpufreq_suspended set Rafael J. Wysocki
2016-04-07  4:28 ` Viresh Kumar
2016-04-07 11:22   ` Rafael J. Wysocki
2016-04-07 11:32     ` Viresh Kumar
2016-04-07 11:44       ` Rafael J. Wysocki
2016-04-07 12:05         ` Viresh Kumar
2016-04-07 22:05           ` Rafael J. Wysocki
2016-04-08  5:44             ` Viresh Kumar
2016-04-08 21:56               ` Rafael J. Wysocki
2016-04-08  5:45 ` Viresh Kumar
2016-04-08 21:54   ` Rafael J. Wysocki
2016-04-10  3:16     ` Viresh Kumar
2016-04-10  3:46       ` Rafael J. Wysocki
2016-04-10  4:08         ` [PATCH] cpufreq: Abort cpufreq_update_current_freq() " Rafael J. Wysocki
2016-04-10  4:10           ` Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox