[patch]cpufreq state info wrong after resume
From: Shaohua Li
Date: Wed Apr 23 2008 - 05:18:21 EST
Sometimes old_index != stat->last_index, see cpufreq_update_policy, bios
can change cpu setting in resume. In my test, after resume cpu is in
lowest speed, but the stat info shows cpu is in full speed. This patch
makes the stat info correct after a resume.
Signed-off-by: Shaohua Li <shaohua.li@xxxxxxxxx>
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c
index 070421a..78bd2f3 100644
--- a/drivers/cpufreq/cpufreq_stats.c
+++ b/drivers/cpufreq/cpufreq_stats.c
@@ -284,7 +284,7 @@ cpufreq_stat_notifier_trans (struct notifier_block *nb, unsigned long val,
if (!stat)
return 0;
- old_index = freq_table_get_index(stat, freq->old);
+ old_index = stat->last_index;
new_index = freq_table_get_index(stat, freq->new);
cpufreq_stats_update(freq->cpu);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/