From: Dominik Brodowski Date: Sun, 26 Mar 2006 09:11:03 +0000 (+0200) Subject: [PATCH] cpufreq_ondemand: add range check X-Git-Tag: v2.6.17-rc1~207^2~3^2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=7c9d8c0e84d395a01289ebd1597758939a875a86;p=linux-2.6-omap-h63xx.git [PATCH] cpufreq_ondemand: add range check Assert that cpufreq_target is, at least, called with the minimum frequency allowed by this policy, not something lower. It triggered problems on ARM. Signed-off-by: Dominik Brodowski --- diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index cd846f57147..956d121cb16 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c @@ -351,6 +351,9 @@ static void dbs_check_cpu(int cpu) freq_next = (freq_next * policy->cur) / (dbs_tuners_ins.up_threshold - 10); + if (freq_next < policy->min) + freq_next = policy->min; + if (freq_next <= ((policy->cur * 95) / 100)) __cpufreq_driver_target(policy, freq_next, CPUFREQ_RELATION_L); }