diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-12-07 19:04:17 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-12-07 19:04:17 -0500 |
commit | 12205a4b79bef56ef618a4b7caa840c5c971cff2 (patch) | |
tree | fea1a7f7af347e5e2766031a77286e7556b38d2e | |
parent | 374b105797c3d4f29c685f3be535c35f5689b30e (diff) |
Revert "cpufreq: suspend governors on system suspend/hibernate"
Commit 5a87182aa21d (cpufreq: suspend governors on system
suspend/hibernate) causes hibernation problems to happen on
Bjørn Mork's and Paul Bolle's systems, so revert it.
Fixes: 5a87182aa21d (cpufreq: suspend governors on system suspend/hibernate)
Reported-by: Bjørn Mork <bjorn@mork.no>
Reported-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/base/power/main.c | 3 | ||||
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 43 | ||||
-rw-r--r-- | include/linux/cpufreq.h | 8 |
3 files changed, 0 insertions, 54 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index e3219dfd736c..1b41fca3d65a 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <linux/async.h> | 29 | #include <linux/async.h> |
30 | #include <linux/suspend.h> | 30 | #include <linux/suspend.h> |
31 | #include <trace/events/power.h> | 31 | #include <trace/events/power.h> |
32 | #include <linux/cpufreq.h> | ||
33 | #include <linux/cpuidle.h> | 32 | #include <linux/cpuidle.h> |
34 | #include <linux/timer.h> | 33 | #include <linux/timer.h> |
35 | 34 | ||
@@ -541,7 +540,6 @@ static void dpm_resume_noirq(pm_message_t state) | |||
541 | dpm_show_time(starttime, state, "noirq"); | 540 | dpm_show_time(starttime, state, "noirq"); |
542 | resume_device_irqs(); | 541 | resume_device_irqs(); |
543 | cpuidle_resume(); | 542 | cpuidle_resume(); |
544 | cpufreq_resume(); | ||
545 | } | 543 | } |
546 | 544 | ||
547 | /** | 545 | /** |
@@ -957,7 +955,6 @@ static int dpm_suspend_noirq(pm_message_t state) | |||
957 | ktime_t starttime = ktime_get(); | 955 | ktime_t starttime = ktime_get(); |
958 | int error = 0; | 956 | int error = 0; |
959 | 957 | ||
960 | cpufreq_suspend(); | ||
961 | cpuidle_pause(); | 958 | cpuidle_pause(); |
962 | suspend_device_irqs(); | 959 | suspend_device_irqs(); |
963 | mutex_lock(&dpm_list_mtx); | 960 | mutex_lock(&dpm_list_mtx); |
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 81e9d4412db8..b7c3b877da44 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/module.h> | 26 | #include <linux/module.h> |
27 | #include <linux/mutex.h> | 27 | #include <linux/mutex.h> |
28 | #include <linux/slab.h> | 28 | #include <linux/slab.h> |
29 | #include <linux/suspend.h> | ||
30 | #include <linux/syscore_ops.h> | 29 | #include <linux/syscore_ops.h> |
31 | #include <linux/tick.h> | 30 | #include <linux/tick.h> |
32 | #include <trace/events/power.h> | 31 | #include <trace/events/power.h> |
@@ -48,9 +47,6 @@ static LIST_HEAD(cpufreq_policy_list); | |||
48 | static DEFINE_PER_CPU(char[CPUFREQ_NAME_LEN], cpufreq_cpu_governor); | 47 | static DEFINE_PER_CPU(char[CPUFREQ_NAME_LEN], cpufreq_cpu_governor); |
49 | #endif | 48 | #endif |
50 | 49 | ||
51 | /* Flag to suspend/resume CPUFreq governors */ | ||
52 | static bool cpufreq_suspended; | ||
53 | |||
54 | static inline bool has_target(void) | 50 | static inline bool has_target(void) |
55 | { | 51 | { |
56 | return cpufreq_driver->target_index || cpufreq_driver->target; | 52 | return cpufreq_driver->target_index || cpufreq_driver->target; |
@@ -1466,41 +1462,6 @@ static struct subsys_interface cpufreq_interface = { | |||
1466 | .remove_dev = cpufreq_remove_dev, | 1462 | .remove_dev = cpufreq_remove_dev, |
1467 | }; | 1463 | }; |
1468 | 1464 | ||
1469 | void cpufreq_suspend(void) | ||
1470 | { | ||
1471 | struct cpufreq_policy *policy; | ||
1472 | |||
1473 | if (!has_target()) | ||
1474 | return; | ||
1475 | |||
1476 | pr_debug("%s: Suspending Governors\n", __func__); | ||
1477 | |||
1478 | list_for_each_entry(policy, &cpufreq_policy_list, policy_list) | ||
1479 | if (__cpufreq_governor(policy, CPUFREQ_GOV_STOP)) | ||
1480 | pr_err("%s: Failed to stop governor for policy: %p\n", | ||
1481 | __func__, policy); | ||
1482 | |||
1483 | cpufreq_suspended = true; | ||
1484 | } | ||
1485 | |||
1486 | void cpufreq_resume(void) | ||
1487 | { | ||
1488 | struct cpufreq_policy *policy; | ||
1489 | |||
1490 | if (!has_target()) | ||
1491 | return; | ||
1492 | |||
1493 | pr_debug("%s: Resuming Governors\n", __func__); | ||
1494 | |||
1495 | cpufreq_suspended = false; | ||
1496 | |||
1497 | list_for_each_entry(policy, &cpufreq_policy_list, policy_list) | ||
1498 | if (__cpufreq_governor(policy, CPUFREQ_GOV_START) | ||
1499 | || __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS)) | ||
1500 | pr_err("%s: Failed to start governor for policy: %p\n", | ||
1501 | __func__, policy); | ||
1502 | } | ||
1503 | |||
1504 | /** | 1465 | /** |
1505 | * cpufreq_bp_suspend - Prepare the boot CPU for system suspend. | 1466 | * cpufreq_bp_suspend - Prepare the boot CPU for system suspend. |
1506 | * | 1467 | * |
@@ -1803,10 +1764,6 @@ static int __cpufreq_governor(struct cpufreq_policy *policy, | |||
1803 | struct cpufreq_governor *gov = NULL; | 1764 | struct cpufreq_governor *gov = NULL; |
1804 | #endif | 1765 | #endif |
1805 | 1766 | ||
1806 | /* Don't start any governor operations if we are entering suspend */ | ||
1807 | if (cpufreq_suspended) | ||
1808 | return 0; | ||
1809 | |||
1810 | if (policy->governor->max_transition_latency && | 1767 | if (policy->governor->max_transition_latency && |
1811 | policy->cpuinfo.transition_latency > | 1768 | policy->cpuinfo.transition_latency > |
1812 | policy->governor->max_transition_latency) { | 1769 | policy->governor->max_transition_latency) { |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index ee5fe9d77ae8..dc196bbcf227 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -280,14 +280,6 @@ cpufreq_verify_within_cpu_limits(struct cpufreq_policy *policy) | |||
280 | policy->cpuinfo.max_freq); | 280 | policy->cpuinfo.max_freq); |
281 | } | 281 | } |
282 | 282 | ||
283 | #ifdef CONFIG_CPU_FREQ | ||
284 | void cpufreq_suspend(void); | ||
285 | void cpufreq_resume(void); | ||
286 | #else | ||
287 | static inline void cpufreq_suspend(void) {} | ||
288 | static inline void cpufreq_resume(void) {} | ||
289 | #endif | ||
290 | |||
291 | /********************************************************************* | 283 | /********************************************************************* |
292 | * CPUFREQ NOTIFIER INTERFACE * | 284 | * CPUFREQ NOTIFIER INTERFACE * |
293 | *********************************************************************/ | 285 | *********************************************************************/ |