From: Thomas Renninger <trenn@suse.de>
To: Naga Chumbalkar <nagananda.chumbalkar@hp.com>
Cc: davej@redhat.com, mjg@redhat.com, cpufreq@vger.kernel.org,
linux-acpi@vger.kernel.org, linux@brodo.de
Subject: [PATCH 2/2] cpufreq: Fix ondemand to not request targets outside policy limits
Date: Mon, 21 Dec 2009 23:40:52 +0100 [thread overview]
Message-ID: <200912212340.54067.trenn@suse.de> (raw)
In-Reply-To: <20091217201800.9473.12769.sendpatchset@localhost.localdomain>
From: Nagananda.Chumbalkar@hp.com
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>
# diff -bur x/drivers/cpufreq/cpufreq_ondemand.c.orig y/drivers/cpufreq/cpufreq_ondemand.c
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index 4b34ade..bd444dc 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -554,6 +554,9 @@ static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info)
(dbs_tuners_ins.up_threshold -
dbs_tuners_ins.down_differential);
+ if (freq_next < policy->min)
+ freq_next = policy->min;
+
if (!dbs_tuners_ins.powersave_bias) {
__cpufreq_driver_target(policy, freq_next,
CPUFREQ_RELATION_L);
next prev parent reply other threads:[~2009-12-21 22:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-17 20:18 [PATCH v2] cpufreq: Processor Clocking Control interface driver Naga Chumbalkar
2009-12-21 22:40 ` Thomas Renninger [this message]
2009-12-23 18:24 ` [PATCH 2/2] cpufreq: Fix ondemand to not request targets outside policy limits Chumbalkar, Nagananda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200912212340.54067.trenn@suse.de \
--to=trenn@suse.de \
--cc=cpufreq@vger.kernel.org \
--cc=davej@redhat.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux@brodo.de \
--cc=mjg@redhat.com \
--cc=nagananda.chumbalkar@hp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox