Skip to content

Commit

Permalink
[CPUFREQ] conservative: fix dbs_cpufreq_notifier so freq is not locked
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Dave Jones <[email protected]>
  • Loading branch information
jimdigriz authored and Dave Jones committed Feb 25, 2009
1 parent 11a80a9 commit f407a08
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion drivers/cpufreq/cpufreq_conservative.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
freq->cpu);

struct cpufreq_policy *policy;

if (!this_dbs_info->enable)
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;
}
Expand Down

0 comments on commit f407a08

Please sign in to comment.