Skip to content

Commit

Permalink
[PATCH] cpufreq_ondemand: add range check
Browse files Browse the repository at this point in the history
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 <linux@dominikbrodowski.net>
  • Loading branch information
Dominik Brodowski committed Mar 26, 2006
1 parent 9cbad61 commit 7c9d8c0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/cpufreq/cpufreq_ondemand.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 7c9d8c0

Please sign in to comment.