aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq_conservative.c
diff options
context:
space:
mode:
authorAlexander Clouter <alex@digriz.org.uk>2009-02-13 14:01:51 -0500
committerDave Jones <davej@redhat.com>2009-02-24 22:47:32 -0500
commitf407a08bb7eff5ddbe0d9173d8717794a910771f (patch)
treee5c4edd6dcbf993c985c9a510127f8bf3cb98f00 /drivers/cpufreq/cpufreq_conservative.c
parent11a80a9c7668c40c40a03ae15bd2c6b215058b2e (diff)
[CPUFREQ] conservative: fix dbs_cpufreq_notifier so freq is not locked
When someone added the dbs_cpufreq_notifier section to the governor the code ended up causing the frequency to only fall. This is because requested_freq is tinkered with and that should only modified if it has an invlaid value due to changes in the available frequency ranges This should fix #10055. Signed-off-by: Alexander Clouter <alex@digriz.org.uk> Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq_conservative.c')
-rw-r--r--drivers/cpufreq/cpufreq_conservative.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c
index a18cfbf021b3..a16a5b8c1dc5 100644
--- a/drivers/cpufreq/cpufreq_conservative.c
+++ b/drivers/cpufreq/cpufreq_conservative.c
@@ -137,10 +137,21 @@ dbs_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
137 struct cpu_dbs_info_s *this_dbs_info = &per_cpu(cpu_dbs_info, 137 struct cpu_dbs_info_s *this_dbs_info = &per_cpu(cpu_dbs_info,
138 freq->cpu); 138 freq->cpu);
139 139
140 struct cpufreq_policy *policy;
141
140 if (!this_dbs_info->enable) 142 if (!this_dbs_info->enable)
141 return 0; 143 return 0;
142 144
143 this_dbs_info->requested_freq = freq->new; 145 policy = this_dbs_info->cur_policy;
146
147 /*
148 * we only care if our internally tracked freq moves outside
149 * the 'valid' ranges of freqency available to us otherwise
150 * we do not change it
151 */
152 if (this_dbs_info->requested_freq > policy->max
153 || this_dbs_info->requested_freq < policy->min)
154 this_dbs_info->requested_freq = freq->new;
144 155
145 return 0; 156 return 0;
146} 157}