xen/powernow: allow using lowest-power P-state
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 8 Sep 2008 13:01:35 +0000 (14:01 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 8 Sep 2008 13:01:35 +0000 (14:01 +0100)
The MSR field used here indicates the highest numbered valid P-state,
not the first invalid one.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen/arch/x86/acpi/cpufreq/powernow.c

index 50c00b31b409e9b91b5716c0883d8faebc100f9d..d4ab452b4cfd7e8c5a393b9e7c699cf77a8a55e7 100644 (file)
@@ -197,8 +197,8 @@ static int powernow_cpufreq_cpu_init(struct cpufreq_policy *policy)
 
     data->max_freq = perf->states[0].core_frequency * 1000;
     /* table init */
-    for (i=0; i<perf->state_count && i<max_hw_pstate; i++) {
-        if (i>0 && perf->states[i].core_frequency >=
+    for (i = 0; i < perf->state_count && i <= max_hw_pstate; i++) {
+        if (i > 0 && perf->states[i].core_frequency >=
             data->freq_table[valid_states-1].frequency / 1000)
             continue;