From: Guillaume Chazarain <guichaz@yahoo.fr>
To: linux-acpi@vger.kernel.org
Subject: scaling_cur_freq is broken with acpi-cpufreq driver and ondemand governor
Date: Sun, 24 Dec 2006 23:32:47 +0100 [thread overview]
Message-ID: <458F000F.5050401@yahoo.fr> (raw)
[-- Attachment #1: Type: text/plain, Size: 817 bytes --]
Hi,
As of linux-2.6.20-rc2 using acpi-cpufreq and ondemand on my Pentium M
(Asus V6VA laptop) seems broken.
/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq contains most of
the time 1, sometimes the actual frequency or (rarely) some random value.
The problem seems to come from
http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=7650b281b091f39f5e97f13b45ab3813b1526b65
The attached patch fixes the problem for me, but it was obtained from
random mutilations of the aforementioned patch. For instance, I don't
understand how cmd.val is used, the freqs.old = extract_freq(cmd.val,
data); I introduced seems to use an uninitialized value from reading the
code. But it seems to be also the case in cmd.val = (cmd.val &
~INTEL_MSR_RANGE) | msr;
Thanks.
--
Guillaume
[-- Attachment #2: ACPI-CPUFREQ.diff --]
[-- Type: text/x-patch, Size: 763 bytes --]
--- a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
+++ b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -400,6 +400,8 @@ static int acpi_cpufreq_target(struct cp
online_policy_cpus = policy->cpus;
#endif
+ freqs.old = extract_freq(cmd.val, data);
+ freqs.new = data->freq_table[next_state].frequency;
next_perf_state = data->freq_table[next_state].index;
if (perf->state == next_perf_state) {
if (unlikely(data->resume)) {
@@ -439,8 +441,6 @@ static int acpi_cpufreq_target(struct cp
else
cpu_set(policy->cpu, cmd.mask);
- freqs.old = data->freq_table[perf->state].frequency;
- freqs.new = data->freq_table[next_perf_state].frequency;
for_each_cpu_mask(i, cmd.mask) {
freqs.cpu = i;
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
reply other threads:[~2006-12-24 23:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=458F000F.5050401@yahoo.fr \
--to=guichaz@yahoo.fr \
--cc=linux-acpi@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.