aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>2013-05-15 15:47:17 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-05-15 15:47:17 -0400
commita66b2e503fc79fff6632d02ef5a0ee47c1d2553d (patch)
treebd4ffaa7b2b1f93007ae73eaa090c54b50c1f161 /drivers/cpufreq
parentb57ffac5e57bff33dde3cff35dff5c41876a6d12 (diff)
cpufreq: Preserve sysfs files across suspend/resume
The file permissions of cpufreq per-cpu sysfs files are not preserved across suspend/resume because we internally go through the CPU Hotplug path which reinitializes the file permissions on CPU online. But the user is not supposed to know that we are using CPU hotplug internally within suspend/resume (IOW, the kernel should not silently wreck the user-set file permissions across a suspend cycle). Therefore, we need to preserve the file permissions as they are across suspend/resume. The simplest way to achieve that is to just not touch the sysfs files at all - ie., just ignore the CPU hotplug notifications in the suspend/resume path (_FROZEN) in the cpufreq hotplug callback. Reported-by: Robert Jarzmik <robert.jarzmik@intel.com> Reported-by: Durgadoss R <durgadoss.r@intel.com> Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/cpufreq.c4
-rw-r--r--drivers/cpufreq/cpufreq_stats.c7
2 files changed, 5 insertions, 6 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index b7acfd153bf9..4b8c7f297d74 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1832,15 +1832,13 @@ static int __cpuinit cpufreq_cpu_callback(struct notifier_block *nfb,
1832 if (dev) { 1832 if (dev) {
1833 switch (action) { 1833 switch (action) {
1834 case CPU_ONLINE: 1834 case CPU_ONLINE:
1835 case CPU_ONLINE_FROZEN:
1836 cpufreq_add_dev(dev, NULL); 1835 cpufreq_add_dev(dev, NULL);
1837 break; 1836 break;
1838 case CPU_DOWN_PREPARE: 1837 case CPU_DOWN_PREPARE:
1839 case CPU_DOWN_PREPARE_FROZEN: 1838 case CPU_UP_CANCELED_FROZEN:
1840 __cpufreq_remove_dev(dev, NULL); 1839 __cpufreq_remove_dev(dev, NULL);
1841 break; 1840 break;
1842 case CPU_DOWN_FAILED: 1841 case CPU_DOWN_FAILED:
1843 case CPU_DOWN_FAILED_FROZEN:
1844 cpufreq_add_dev(dev, NULL); 1842 cpufreq_add_dev(dev, NULL);
1845 break; 1843 break;
1846 } 1844 }
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c
index bfd6273fd873..fb65decffa28 100644
--- a/drivers/cpufreq/cpufreq_stats.c
+++ b/drivers/cpufreq/cpufreq_stats.c
@@ -349,15 +349,16 @@ static int __cpuinit cpufreq_stat_cpu_callback(struct notifier_block *nfb,
349 349
350 switch (action) { 350 switch (action) {
351 case CPU_ONLINE: 351 case CPU_ONLINE:
352 case CPU_ONLINE_FROZEN:
353 cpufreq_update_policy(cpu); 352 cpufreq_update_policy(cpu);
354 break; 353 break;
355 case CPU_DOWN_PREPARE: 354 case CPU_DOWN_PREPARE:
356 case CPU_DOWN_PREPARE_FROZEN:
357 cpufreq_stats_free_sysfs(cpu); 355 cpufreq_stats_free_sysfs(cpu);
358 break; 356 break;
359 case CPU_DEAD: 357 case CPU_DEAD:
360 case CPU_DEAD_FROZEN: 358 cpufreq_stats_free_table(cpu);
359 break;
360 case CPU_UP_CANCELED_FROZEN:
361 cpufreq_stats_free_sysfs(cpu);
361 cpufreq_stats_free_table(cpu); 362 cpufreq_stats_free_table(cpu);
362 break; 363 break;
363 } 364 }