Commit 7c9d8c0e authored by Dominik Brodowski's avatar Dominik Brodowski

[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: default avatarDominik Brodowski <linux@dominikbrodowski.net>
parent 9cbad61b
...@@ -351,6 +351,9 @@ static void dbs_check_cpu(int cpu) ...@@ -351,6 +351,9 @@ static void dbs_check_cpu(int cpu)
freq_next = (freq_next * policy->cur) / freq_next = (freq_next * policy->cur) /
(dbs_tuners_ins.up_threshold - 10); (dbs_tuners_ins.up_threshold - 10);
if (freq_next < policy->min)
freq_next = policy->min;
if (freq_next <= ((policy->cur * 95) / 100)) if (freq_next <= ((policy->cur * 95) / 100))
__cpufreq_driver_target(policy, freq_next, CPUFREQ_RELATION_L); __cpufreq_driver_target(policy, freq_next, CPUFREQ_RELATION_L);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment