From: "Jan Beulich" Subject: [PATCH] xen/powernow: allow using lowest-power P-state Date: Mon, 08 Sep 2008 13:55:33 +0100 Message-ID: <48C53CE5.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: mark.langsdorf@amd.com List-Id: xen-devel@lists.xenproject.org The MSR field used here indicates the highest numbered valid P-state, not the first invalid one. Signed-off-by: Jan Beulich Index: 2008-09-01/xen/arch/x86/acpi/cpufreq/powernow.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 2008-09-01.orig/xen/arch/x86/acpi/cpufreq/powernow.c 2008-07-18 = 16:19:34.000000000 +0200 +++ 2008-09-01/xen/arch/x86/acpi/cpufreq/powernow.c 2008-09-08 = 14:46:12.000000000 +0200 @@ -197,8 +197,8 @@ static int powernow_cpufreq_cpu_init(str =20 data->max_freq =3D perf->states[0].core_frequency * 1000; /* table init */ - for (i=3D0; istate_count && i0 && perf->states[i].core_frequency >=3D + for (i =3D 0; i < perf->state_count && i <=3D max_hw_pstate; i++) { + if (i > 0 && perf->states[i].core_frequency >=3D data->freq_table[valid_states-1].frequency / 1000) continue; =20