aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>2013-07-11 18:15:37 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-07-14 19:31:36 -0400
commitaae760ed21cd690fe8a6db9f3a177ad55d7e12ab (patch)
tree7dce6578c129597fe471f2e40fd41c0a7b4b4f33
parentad81f0545ef01ea651886dddac4bef6cec930092 (diff)
cpufreq: Revert commit a66b2e to fix suspend/resume regression
commit a66b2e (cpufreq: Preserve sysfs files across suspend/resume) has unfortunately caused several things in the cpufreq subsystem to break subtly after a suspend/resume cycle. The intention of that patch was to retain the file permissions of the cpufreq related sysfs files across suspend/resume. To achieve that, the commit completely removed the calls to cpufreq_add_dev() and __cpufreq_remove_dev() during suspend/resume transitions. But the problem is that those functions do 2 kinds of things: 1. Low-level initialization/tear-down that are critical to the correct functioning of cpufreq-core. 2. Kobject and sysfs related initialization/teardown. Ideally we should have reorganized the code to cleanly separate these two responsibilities, and skipped only the sysfs related parts during suspend/resume. Since we skipped the entire callbacks instead (which also included some CPU and cpufreq-specific critical components), cpufreq subsystem started behaving erratically after suspend/resume. So revert the commit to fix the regression. We'll revisit and address the original goal of that commit separately, since it involves quite a bit of careful code reorganization and appears to be non-trivial. (While reverting the commit, note that another commit f51e1eb (cpufreq: Fix cpufreq regression after suspend/resume) already reverted part of the original set of changes. So revert only the remaining ones). Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Tested-by: Paul Bolle <pebolle@tiscali.nl> Cc: 3.10+ <stable@vger.kernel.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/cpufreq/cpufreq.c4
-rw-r--r--drivers/cpufreq/cpufreq_stats.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 0937b8d6c2a4..7dcfa6854833 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1942,13 +1942,15 @@ static int __cpuinit cpufreq_cpu_callback(struct notifier_block *nfb,
1942 if (dev) { 1942 if (dev) {
1943 switch (action) { 1943 switch (action) {
1944 case CPU_ONLINE: 1944 case CPU_ONLINE:
1945 case CPU_ONLINE_FROZEN:
1945 cpufreq_add_dev(dev, NULL); 1946 cpufreq_add_dev(dev, NULL);
1946 break; 1947 break;
1947 case CPU_DOWN_PREPARE: 1948 case CPU_DOWN_PREPARE:
1948 case CPU_UP_CANCELED_FROZEN: 1949 case CPU_DOWN_PREPARE_FROZEN:
1949 __cpufreq_remove_dev(dev, NULL); 1950 __cpufreq_remove_dev(dev, NULL);
1950 break; 1951 break;
1951 case CPU_DOWN_FAILED: 1952 case CPU_DOWN_FAILED:
1953 case CPU_DOWN_FAILED_FROZEN:
1952 cpufreq_add_dev(dev, NULL); 1954 cpufreq_add_dev(dev, NULL);
1953 break; 1955 break;
1954 } 1956 }
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c
index cd9e81713a71..12225d19ffcb 100644
--- a/drivers/cpufreq/cpufreq_stats.c
+++ b/drivers/cpufreq/cpufreq_stats.c
@@ -353,13 +353,11 @@ static int __cpuinit cpufreq_stat_cpu_callback(struct notifier_block *nfb,
353 cpufreq_update_policy(cpu); 353 cpufreq_update_policy(cpu);
354 break; 354 break;
355 case CPU_DOWN_PREPARE: 355 case CPU_DOWN_PREPARE:
356 case CPU_DOWN_PREPARE_FROZEN:
356 cpufreq_stats_free_sysfs(cpu); 357 cpufreq_stats_free_sysfs(cpu);
357 break; 358 break;
358 case CPU_DEAD: 359 case CPU_DEAD:
359 cpufreq_stats_free_table(cpu); 360 case CPU_DEAD_FROZEN:
360 break;
361 case CPU_UP_CANCELED_FROZEN:
362 cpufreq_stats_free_sysfs(cpu);
363 cpufreq_stats_free_table(cpu); 361 cpufreq_stats_free_table(cpu);
364 break; 362 break;
365 } 363 }