cpufreq: Revert "cpufreq: Don't iterate over all CPUs when suspending and resuming governors"

This reverts commit 212df5dd32.

The commit it's fixing has too many other dependencies.

Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
Mark Brown
2015-03-09 12:25:38 +00:00
committed by Mark Brown
parent 212df5dd32
commit d255fcab2b

View File

@@ -1293,6 +1293,7 @@ static struct subsys_interface cpufreq_interface = {
void cpufreq_suspend(void)
{
struct cpufreq_policy *policy;
int cpu;
if (!cpufreq_driver)
return;
@@ -1302,15 +1303,20 @@ void cpufreq_suspend(void)
pr_debug("%s: Suspending Governors\n", __func__);
policy = cpufreq_cpu_get(0);
for_each_possible_cpu(cpu) {
if (!cpu_online(cpu))
continue;
if (__cpufreq_governor(policy, CPUFREQ_GOV_STOP))
pr_err("%s: Failed to stop governor for policy: %p\n",
__func__, policy);
else if (cpufreq_driver->suspend
&& cpufreq_driver->suspend(policy))
pr_err("%s: Failed to suspend driver: %p\n", __func__,
policy);
policy = cpufreq_cpu_get(cpu);
if (__cpufreq_governor(policy, CPUFREQ_GOV_STOP))
pr_err("%s: Failed to stop governor for policy: %p\n",
__func__, policy);
else if (cpufreq_driver->suspend
&& cpufreq_driver->suspend(policy))
pr_err("%s: Failed to suspend driver: %p\n", __func__,
policy);
}
cpufreq_suspended = true;
}
@@ -1324,6 +1330,7 @@ void cpufreq_suspend(void)
void cpufreq_resume(void)
{
struct cpufreq_policy *policy;
int cpu;
if (!cpufreq_driver)
return;
@@ -1335,18 +1342,29 @@ void cpufreq_resume(void)
cpufreq_suspended = false;
policy = cpufreq_cpu_get(0);
for_each_possible_cpu(cpu) {
if (!cpu_online(cpu))
continue;
if (__cpufreq_governor(policy, CPUFREQ_GOV_START)
|| __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS))
pr_err("%s: Failed to start governor for policy: %p\n",
__func__, policy);
else if (cpufreq_driver->resume
&& cpufreq_driver->resume(policy))
pr_err("%s: Failed to resume driver: %p\n", __func__,
policy);
policy = cpufreq_cpu_get(cpu);
schedule_work(&policy->update);
if (__cpufreq_governor(policy, CPUFREQ_GOV_START)
|| __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS))
pr_err("%s: Failed to start governor for policy: %p\n",
__func__, policy);
else if (cpufreq_driver->resume
&& cpufreq_driver->resume(policy))
pr_err("%s: Failed to resume driver: %p\n", __func__,
policy);
/*
* schedule call cpufreq_update_policy() for boot CPU, i.e. last
* policy in list. It will verify that the current freq is in
* sync with what we believe it to be.
*/
if (cpu == 0)
schedule_work(&policy->update);
}
}
/**