All of lore.kernel.org
 help / color / mirror / Atom feed
* scaling_cur_freq is broken with acpi-cpufreq driver and ondemand governor
@ 2006-12-24 22:32 Guillaume Chazarain
  0 siblings, 0 replies; only message in thread
From: Guillaume Chazarain @ 2006-12-24 22:32 UTC (permalink / raw)
  To: linux-acpi

[-- 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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-12-24 23:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-24 22:32 scaling_cur_freq is broken with acpi-cpufreq driver and ondemand governor Guillaume Chazarain

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.