Skip to contentSkip to conversation

cpufreq state info wrong after resume

PATCH New Shaohua Li 1 participant 1 message Apr 23, 2008 CPU frequency scaling framework

lore
Share & tools
lore

Shaohua Li

author
#0 lore raw

PATCH 1/1 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.

drivers/cpufreq/cpufreq_stats.c +1 -1
index 070421a..78bd2f3 100644
@@ -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);