Commit f407a08b authored by Alexander Clouter's avatar Alexander Clouter Committed by Dave Jones

[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: default avatarAlexander Clouter <alex@digriz.org.uk>
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent 11a80a9c
...@@ -137,10 +137,21 @@ dbs_cpufreq_notifier(struct notifier_block *nb, unsigned long val, ...@@ -137,10 +137,21 @@ dbs_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
struct cpu_dbs_info_s *this_dbs_info = &per_cpu(cpu_dbs_info, struct cpu_dbs_info_s *this_dbs_info = &per_cpu(cpu_dbs_info,
freq->cpu); freq->cpu);
struct cpufreq_policy *policy;
if (!this_dbs_info->enable) if (!this_dbs_info->enable)
return 0; return 0;
this_dbs_info->requested_freq = freq->new; policy = this_dbs_info->cur_policy;
/*
* we only care if our internally tracked freq moves outside
* the 'valid' ranges of freqency available to us otherwise
* we do not change it
*/
if (this_dbs_info->requested_freq > policy->max
|| this_dbs_info->requested_freq < policy->min)
this_dbs_info->requested_freq = freq->new;
return 0; return 0;
} }
......
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