Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

-54
-3
drivers/base/power/main.c
··· 29 29 #include <linux/async.h> 30 30 #include <linux/suspend.h> 31 31 #include <trace/events/power.h> 32 - #include <linux/cpufreq.h> 33 32 #include <linux/cpuidle.h> 34 33 #include <linux/timer.h> 35 34 ··· 540 541 dpm_show_time(starttime, state, "noirq"); 541 542 resume_device_irqs(); 542 543 cpuidle_resume(); 543 - cpufreq_resume(); 544 544 } 545 545 546 546 /** ··· 955 957 ktime_t starttime = ktime_get(); 956 958 int error = 0; 957 959 958 - cpufreq_suspend(); 959 960 cpuidle_pause(); 960 961 suspend_device_irqs(); 961 962 mutex_lock(&dpm_list_mtx);
-43
drivers/cpufreq/cpufreq.c
··· 26 26 #include <linux/module.h> 27 27 #include <linux/mutex.h> 28 28 #include <linux/slab.h> 29 - #include <linux/suspend.h> 30 29 #include <linux/syscore_ops.h> 31 30 #include <linux/tick.h> 32 31 #include <trace/events/power.h> ··· 46 47 /* This one keeps track of the previously set governor of a removed CPU */ 47 48 static DEFINE_PER_CPU(char[CPUFREQ_NAME_LEN], cpufreq_cpu_governor); 48 49 #endif 49 - 50 - /* Flag to suspend/resume CPUFreq governors */ 51 - static bool cpufreq_suspended; 52 50 53 51 static inline bool has_target(void) 54 52 { ··· 1462 1466 .remove_dev = cpufreq_remove_dev, 1463 1467 }; 1464 1468 1465 - void cpufreq_suspend(void) 1466 - { 1467 - struct cpufreq_policy *policy; 1468 - 1469 - if (!has_target()) 1470 - return; 1471 - 1472 - pr_debug("%s: Suspending Governors\n", __func__); 1473 - 1474 - list_for_each_entry(policy, &cpufreq_policy_list, policy_list) 1475 - if (__cpufreq_governor(policy, CPUFREQ_GOV_STOP)) 1476 - pr_err("%s: Failed to stop governor for policy: %p\n", 1477 - __func__, policy); 1478 - 1479 - cpufreq_suspended = true; 1480 - } 1481 - 1482 - void cpufreq_resume(void) 1483 - { 1484 - struct cpufreq_policy *policy; 1485 - 1486 - if (!has_target()) 1487 - return; 1488 - 1489 - pr_debug("%s: Resuming Governors\n", __func__); 1490 - 1491 - cpufreq_suspended = false; 1492 - 1493 - list_for_each_entry(policy, &cpufreq_policy_list, policy_list) 1494 - if (__cpufreq_governor(policy, CPUFREQ_GOV_START) 1495 - || __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS)) 1496 - pr_err("%s: Failed to start governor for policy: %p\n", 1497 - __func__, policy); 1498 - } 1499 - 1500 1469 /** 1501 1470 * cpufreq_bp_suspend - Prepare the boot CPU for system suspend. 1502 1471 * ··· 1763 1802 #else 1764 1803 struct cpufreq_governor *gov = NULL; 1765 1804 #endif 1766 - 1767 - /* Don't start any governor operations if we are entering suspend */ 1768 - if (cpufreq_suspended) 1769 - return 0; 1770 1805 1771 1806 if (policy->governor->max_transition_latency && 1772 1807 policy->cpuinfo.transition_latency >
-8
include/linux/cpufreq.h
··· 280 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 284 * CPUFREQ NOTIFIER INTERFACE * 293 285 *********************************************************************/