[CPUFREQ] state info wrong after resume
authorShaohua Li <shaohua.li@intel.com>
Sun, 27 Apr 2008 20:46:56 +0000 (13:46 -0700)
committerDave Jones <davej@redhat.com>
Mon, 28 Apr 2008 20:27:08 +0000 (16:27 -0400)
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@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dave Jones <davej@redhat.com>
drivers/cpufreq/cpufreq_stats.c

index ef09e06..ae70d63 100644 (file)
@@ -288,7 +288,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);