From: Shaohua Li Date: Sun, 27 Apr 2008 20:46:56 +0000 (-0700) Subject: [CPUFREQ] state info wrong after resume X-Git-Tag: firefly_0821_release~20848^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6501faf8c1bbaa51dc493f3681df016d2ebce833;p=firefly-linux-kernel-4.4.55.git [CPUFREQ] state info wrong after resume 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 Signed-off-by: Andrew Morton Signed-off-by: Dave Jones --- diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c index ef09e069433b..ae70d63a8b26 100644 --- a/drivers/cpufreq/cpufreq_stats.c +++ b/drivers/cpufreq/cpufreq_stats.c @@ -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);