diff options
author | Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> | 2006-12-19 15:58:55 -0500 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2006-12-22 22:45:41 -0500 |
commit | 8edc59d939ad233c24385fb67a62bd39db532901 (patch) | |
tree | 68f3f3fabc5310d0d3c0cdae1db1d4aef33ddccd /drivers/cpufreq/cpufreq_stats.c | |
parent | 917325d30ab12f9f23aee5c91dc96dfe81b0c6be (diff) |
[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 <dhaval.giani@gmail.com>
Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq_stats.c')
-rw-r--r-- | drivers/cpufreq/cpufreq_stats.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c index 6742b1adf2c8..91ad342a6051 100644 --- a/drivers/cpufreq/cpufreq_stats.c +++ b/drivers/cpufreq/cpufreq_stats.c | |||
@@ -285,6 +285,7 @@ cpufreq_stat_notifier_trans (struct notifier_block *nb, unsigned long val, | |||
285 | stat = cpufreq_stats_table[freq->cpu]; | 285 | stat = cpufreq_stats_table[freq->cpu]; |
286 | if (!stat) | 286 | if (!stat) |
287 | return 0; | 287 | return 0; |
288 | |||
288 | old_index = freq_table_get_index(stat, freq->old); | 289 | old_index = freq_table_get_index(stat, freq->old); |
289 | new_index = freq_table_get_index(stat, freq->new); | 290 | new_index = freq_table_get_index(stat, freq->new); |
290 | 291 | ||
@@ -292,6 +293,9 @@ cpufreq_stat_notifier_trans (struct notifier_block *nb, unsigned long val, | |||
292 | if (old_index == new_index) | 293 | if (old_index == new_index) |
293 | return 0; | 294 | return 0; |
294 | 295 | ||
296 | if (old_index == -1 || new_index == -1) | ||
297 | return 0; | ||
298 | |||
295 | spin_lock(&cpufreq_stats_lock); | 299 | spin_lock(&cpufreq_stats_lock); |
296 | stat->last_index = new_index; | 300 | stat->last_index = new_index; |
297 | #ifdef CONFIG_CPU_FREQ_STAT_DETAILS | 301 | #ifdef CONFIG_CPU_FREQ_STAT_DETAILS |