GIT d349c4a5ae1f17be8d6d5de30135ce17e0a8623b git+ssh://master.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq.git commit Author: Brice Goglin Date: Wed Dec 20 14:11:21 2006 +0100 [CPUFREQ] speedstep-centrino: missing space and bracket A space and a bracket are missing (and indentation is wrong). Signed-off-by: Brice Goglin Signed-off-by: Dave Jones commit 8edc59d939ad233c24385fb67a62bd39db532901 Author: Venkatesh Pallipadi Date: Tue Dec 19 12:58:55 2006 -0800 [CPUFREQ] Bug fix for acpi-cpufreq and cpufreq_stats oops on frequency change notification Fixes the oops in cpufreq_stats with acpi_cpufreq driver. The issue was that the frequency was reported as 0 in acpi-cpufreq.c. The bug is due to different indicies for freq_table and ACPI perf table. Also adds a check in cpufreq_stats to check for error return from freq_table_get_index() and avoid using the error return value. Patch fixes the issue reported at http://www.ussg.iu.edu/hypermail/linux/kernel/0611.2/0629.html and also other similar issue here http://bugme.osdl.org/show_bug.cgi?id=7383 comment 53 Signed-off-by: Dhaval Giani Signed-off-by: Venkatesh Pallipadi Signed-off-by: Andrew Morton Signed-off-by: Dave Jones commit 917325d30ab12f9f23aee5c91dc96dfe81b0c6be Author: Randy Dunlap Date: Tue Dec 19 12:58:54 2006 -0800 [CPUFREQ] select consistently Make x86_64 ACPI_CPU_FREQ select CPU_FREQ_TABLE like other methods do. (although we should still eliminate as much use of 'select' as possible) Signed-off-by: Randy Dunlap Signed-off-by: Andrew Morton Signed-off-by: Dave Jones arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c | 9 +++++---- arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c | 6 +++--- arch/x86_64/kernel/cpufreq/Kconfig | 1 + drivers/cpufreq/cpufreq_stats.c | 4 ++++ 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c index b735458..563dcc8 100644 --- a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c +++ b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c @@ -373,8 +373,8 @@ static int acpi_cpufreq_target(struct cp cpumask_t online_policy_cpus; struct drv_cmd cmd; unsigned int msr; - unsigned int next_state = 0; - unsigned int next_perf_state = 0; + unsigned int next_state = 0; /* Index into freq_table */ + unsigned int next_perf_state = 0; /* Index into perf table */ unsigned int i; int result = 0; @@ -439,8 +439,8 @@ #endif else cpu_set(policy->cpu, cmd.mask); - freqs.old = data->freq_table[perf->state].frequency; - freqs.new = data->freq_table[next_perf_state].frequency; + freqs.old = perf->states[perf->state].core_frequency * 1000; + freqs.new = data->freq_table[next_state].frequency; for_each_cpu_mask(i, cmd.mask) { freqs.cpu = i; cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); @@ -677,6 +677,7 @@ #endif valid_states++; } data->freq_table[valid_states].frequency = CPUFREQ_TABLE_END; + perf->state = 0; result = cpufreq_frequency_table_cpuinfo(policy, data->freq_table); if (result) diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c index 5113e92..f43b987 100644 --- a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c +++ b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c @@ -533,9 +533,9 @@ #endif /* notify BIOS that we exist */ acpi_processor_notify_smm(THIS_MODULE); - printk("speedstep-centrino with X86_SPEEDSTEP_CENTRINO_ACPI" - "config is deprecated.\n " - "Use X86_ACPI_CPUFREQ (acpi-cpufreq instead.\n" ); + printk("speedstep-centrino with X86_SPEEDSTEP_CENTRINO_ACPI " + "config is deprecated.\n " + "Use X86_ACPI_CPUFREQ (acpi-cpufreq) instead.\n" ); return 0; diff --git a/arch/x86_64/kernel/cpufreq/Kconfig b/arch/x86_64/kernel/cpufreq/Kconfig index 3abcfa3..45a6a1f 100644 --- a/arch/x86_64/kernel/cpufreq/Kconfig +++ b/arch/x86_64/kernel/cpufreq/Kconfig @@ -49,6 +49,7 @@ config X86_SPEEDSTEP_CENTRINO_ACPI config X86_ACPI_CPUFREQ tristate "ACPI Processor P-States driver" + select CPU_FREQ_TABLE depends on ACPI_PROCESSOR help This driver adds a CPUFreq driver which utilizes the ACPI diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c index 6742b1a..91ad342 100644 --- a/drivers/cpufreq/cpufreq_stats.c +++ b/drivers/cpufreq/cpufreq_stats.c @@ -285,6 +285,7 @@ cpufreq_stat_notifier_trans (struct noti stat = cpufreq_stats_table[freq->cpu]; if (!stat) return 0; + old_index = freq_table_get_index(stat, freq->old); new_index = freq_table_get_index(stat, freq->new); @@ -292,6 +293,9 @@ cpufreq_stat_notifier_trans (struct noti if (old_index == new_index) return 0; + if (old_index == -1 || new_index == -1) + return 0; + spin_lock(&cpufreq_stats_lock); stat->last_index = new_index; #ifdef CONFIG_CPU_FREQ_STAT_DETAILS