aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2017-03-21 02:06:06 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-30 03:41:27 -0400
commitf565084692d624718d53dbfcc0d9dc31c62bdb78 (patch)
tree95e62b43f02690a7b98300d08861beef40ae6dd3
parentb9ed800f71889795e1f329d4ee84d7778a16797f (diff)
cpufreq: Restore policy min/max limits on CPU online
commit ff010472fb75670cb5c08671e820eeea3af59c87 upstream. On CPU online the cpufreq core restores the previous governor (or the previous "policy" setting for ->setpolicy drivers), but it does not restore the min/max limits at the same time, which is confusing, inconsistent and real pain for users who set the limits and then suspend/resume the system (using full suspend), in which case the limits are reset on all CPUs except for the boot one. Fix this by making cpufreq_online() restore the limits when an inactive policy is brought online. The commit log and patch are inspired from Rafael's earlier work. Reported-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/cpufreq/cpufreq.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 272608f102fb..cac4a92259da 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1190,6 +1190,9 @@ static int cpufreq_online(unsigned int cpu)
1190 for_each_cpu(j, policy->related_cpus) 1190 for_each_cpu(j, policy->related_cpus)
1191 per_cpu(cpufreq_cpu_data, j) = policy; 1191 per_cpu(cpufreq_cpu_data, j) = policy;
1192 write_unlock_irqrestore(&cpufreq_driver_lock, flags); 1192 write_unlock_irqrestore(&cpufreq_driver_lock, flags);
1193 } else {
1194 policy->min = policy->user_policy.min;
1195 policy->max = policy->user_policy.max;
1193 } 1196 }
1194 1197
1195 if (cpufreq_driver->get && !cpufreq_driver->setpolicy) { 1198 if (cpufreq_driver->get && !cpufreq_driver->setpolicy) {