[CPUFREQ] Fix ondemand to not request targets outside policy limits
authorNagananda.Chumbalkar@hp.com <Nagananda.Chumbalkar@hp.com>
Mon, 21 Dec 2009 22:40:52 +0000 (23:40 +0100)
committerMatt Sealey <matt@genesi-usa.com>
Tue, 22 Feb 2011 01:58:22 +0000 (19:58 -0600)
commit6d8b14fb3df81881baaa2379a487bbe011edc58a
treeeb14fc9bf66554cb491d2da5e98692f626a8cacd
parent3ccebe36653085a95997be170c27bb4c116b75ec
[CPUFREQ] Fix ondemand to not request targets outside policy limits

Dominik said:
target_freq cannot be below policy->min or above policy->max.
If it were, the whole cpufreq subsystem is broken.

But (answer):
I think the "ondemand" governor can ask for a target frequency that is
below policy->min.
...
A patch such as below may be needed to sanitize the target frequency
requested by "ondemand". The "conservative" governor already has this check:

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Dave Jones <davej@redhat.com>
# diff -bur x/drivers/cpufreq/cpufreq_ondemand.c.orig y/drivers/cpufreq/cpufreq_ondemand.c
(cherry picked from commit 1dbf58881f307e21a3df4b990a5bea401360d02e)
(cherry picked from commit 5109f7b2bf70d58302b321919860e91976b93993)
drivers/cpufreq/cpufreq_ondemand.c