Permalink
Browse files

cpufreq: Do not forget min/max clock frequency on cpu hotplug

Signed-off-by: netchip <netchip@netchip-archer.localdomain>
  • Loading branch information...
1 parent 80b2572 commit c1f444012c025dbbb8fd1187cb95ba59b6ed1979 @myfluxi myfluxi committed with netchip Mar 27, 2012
Showing with 16 additions and 2 deletions.
  1. +16 −2 drivers/cpufreq/cpufreq.c
View
@@ -1022,6 +1022,18 @@ static int cpufreq_add_dev(struct sys_device *sys_dev)
pr_debug("initialization failed\n");
goto err_unlock_policy;
}
+#ifdef CONFIG_HOTPLUG_CPU
+ for_each_online_cpu(sibling) {
+ struct cpufreq_policy *cp = per_cpu(cpufreq_cpu_data, sibling);
+ if (cp && cp->governor && (cpumask_test_cpu(cpu, cp->related_cpus))) {
+ policy->min = cp->min;
+ policy->min_suspend = cp->min_suspend;
+ policy->max = cp->max;
+ policy->max_suspend = cp->max_suspend;
+ break;
+ }
+ }
+#endif
policy->user_policy.min = policy->min;
policy->user_policy.max = policy->max;
@@ -1725,8 +1737,10 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data,
data->min = policy->min;
data->max = policy->max;
- pr_debug("new min and max freqs are %u - %u kHz\n",
- data->min, data->max);
+ pr_debug("new min and max freqs are %u - %u kHz,\n \
+ min&max_suspend freqs are %u - %u kHz\n",
+ data->min, data->max,
+ data->min_suspend, data->max_suspend);
if (cpufreq_driver->setpolicy) {
data->policy = policy->policy;

0 comments on commit c1f4440

Please sign in to comment.