From: Sonny Rao Date: Fri, 14 Dec 2012 22:48:30 +0000 (-0800) Subject: CHROMIUM: cpufreq: cpu_thermal only allows lower max frequency, fix it X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=62182b261b206d58f447330a3d1803f5322c5a43;p=people%2Faperard%2Flinux-chromebook.git CHROMIUM: cpufreq: cpu_thermal only allows lower max frequency, fix it The cpu_thermal generic thermal management code has a bug where once max cpu frequency has been lowered in sysfs (scaling_max_freq) it is not possible to raise the max back up later. The bug is that the notifer gets called by __cpufreq_set_policy() before the user policy max is raised, and is incorrectly trying to enforce the max frequency policy even when we are trying to change the policy. Signed-off-by: Sonny Rao BUG=chromium-os:36435 TEST=kernel_CpufreqMinMax Change-Id: I12ad4ef5aad544333cad4a9ff1e81f04d1cfa5e8 Reviewed-on: https://gerrit.chromium.org/gerrit/39793 Reviewed-by: Doug Anderson Commit-Ready: Sonny Rao Tested-by: Sonny Rao --- diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index c40d9a09929ae..551d3f2e3f639 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -270,10 +270,6 @@ static int cpufreq_thermal_notifier(struct notifier_block *nb, } } - /* Never exceed user_policy.max*/ - if (max_freq > policy->user_policy.max) - max_freq = policy->user_policy.max; - if (policy->max != max_freq) cpufreq_verify_within_limits(policy, 0, max_freq);