mirror of
https://github.com/LibreELEC/LibreELEC.tv
synced 2025-09-24 19:46:01 +07:00
85 lines
3.4 KiB
Diff
85 lines
3.4 KiB
Diff
This reverts
|
|
https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/patch/?id=9d3ce4af3be0235d4cf41ea9fd774205a32e58a2
|
|
|
|
From 9d3ce4af3be0235d4cf41ea9fd774205a32e58a2 Mon Sep 17 00:00:00 2001
|
|
From: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
|
|
Date: Thu, 11 Jul 2013 22:15:37 +0000
|
|
Subject: cpufreq: Revert commit a66b2e to fix suspend/resume regression
|
|
|
|
commit aae760ed21cd690fe8a6db9f3a177ad55d7e12ab upstream.
|
|
|
|
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>
|
|
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
|
|
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
|
|
---
|
|
diff -Naur linux-3.10.4/drivers/cpufreq/cpufreq.c linux-3.10.4.patch/drivers/cpufreq/cpufreq.c
|
|
--- linux-3.10.4/drivers/cpufreq/cpufreq.c 2013-07-29 01:30:49.000000000 +0200
|
|
+++ linux-3.10.4.patch/drivers/cpufreq/cpufreq.c 2013-07-30 08:08:08.016815021 +0200
|
|
@@ -1837,15 +1837,13 @@
|
|
if (dev) {
|
|
switch (action) {
|
|
case CPU_ONLINE:
|
|
- case CPU_ONLINE_FROZEN:
|
|
cpufreq_add_dev(dev, NULL);
|
|
break;
|
|
case CPU_DOWN_PREPARE:
|
|
- case CPU_DOWN_PREPARE_FROZEN:
|
|
+ case CPU_UP_CANCELED_FROZEN:
|
|
__cpufreq_remove_dev(dev, NULL);
|
|
break;
|
|
case CPU_DOWN_FAILED:
|
|
- case CPU_DOWN_FAILED_FROZEN:
|
|
cpufreq_add_dev(dev, NULL);
|
|
break;
|
|
}
|
|
diff -Naur linux-3.10.4/drivers/cpufreq/cpufreq_stats.c linux-3.10.4.patch/drivers/cpufreq/cpufreq_stats.c
|
|
--- linux-3.10.4/drivers/cpufreq/cpufreq_stats.c 2013-07-29 01:30:49.000000000 +0200
|
|
+++ linux-3.10.4.patch/drivers/cpufreq/cpufreq_stats.c 2013-07-30 08:08:08.016815021 +0200
|
|
@@ -353,11 +353,13 @@
|
|
cpufreq_update_policy(cpu);
|
|
break;
|
|
case CPU_DOWN_PREPARE:
|
|
- case CPU_DOWN_PREPARE_FROZEN:
|
|
cpufreq_stats_free_sysfs(cpu);
|
|
break;
|
|
case CPU_DEAD:
|
|
- case CPU_DEAD_FROZEN:
|
|
+ cpufreq_stats_free_table(cpu);
|
|
+ break;
|
|
+ case CPU_UP_CANCELED_FROZEN:
|
|
+ cpufreq_stats_free_sysfs(cpu);
|
|
cpufreq_stats_free_table(cpu);
|
|
break;
|
|
}
|