Patchwork [Lucid] SRU: powernow-k8: Fix frequency reporting

login
register
mail settings
Submitter Stefan Bader
Date April 30, 2010, 2:12 p.m.
Message ID <1272636767-4537-1-git-send-email-stefan.bader@canonical.com>
Download mbox | patch
Permalink /patch/51335/
State Accepted
Delegated to: Stefan Bader
Headers show

Comments

Stefan Bader - April 30, 2010, 2:12 p.m.
SRU justification:

Impact: This has been reported through AMD. There is a bug in the
frequency governor which prevents the P-states to be correctly set
(no boost).

Fix: This fix has been queued up to linux-next and will be included in
stable as well. To improve performance sooner we would be carrying this
patch as pre-stable.

Testcase: Checking CPU frequencies the boost state without the patch
will never be reached.

-Stefan

From 679370641e3675633cad222449262abbe93a4a2a Mon Sep 17 00:00:00 2001
From: Mark Langsdorf <mark.langsdorf@amd.com>
Date: Wed, 31 Mar 2010 21:56:45 +0200
Subject: [PATCH] powernow-k8: Fix frequency reporting

BugLink: http://bugs.launchpad.net/bugs/572348

With F10, model 10, all valid frequencies are in the ACPI _PST table.

Cc: <stable@kernel.org> # 33.x 32.x
Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>
LKML-Reference: <1270065406-1814-6-git-send-email-bp@amd64.org>
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Reviewed-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
---
 arch/x86/kernel/cpu/cpufreq/powernow-k8.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
Tim Gardner - May 3, 2010, 2:15 p.m.
On 04/30/2010 03:12 PM, Stefan Bader wrote:
> SRU justification:
>
> Impact: This has been reported through AMD. There is a bug in the
> frequency governor which prevents the P-states to be correctly set
> (no boost).
>
> Fix: This fix has been queued up to linux-next and will be included in
> stable as well. To improve performance sooner we would be carrying this
> patch as pre-stable.
>
> Testcase: Checking CPU frequencies the boost state without the patch
> will never be reached.
>
> -Stefan
>
>  From 679370641e3675633cad222449262abbe93a4a2a Mon Sep 17 00:00:00 2001
> From: Mark Langsdorf<mark.langsdorf@amd.com>
> Date: Wed, 31 Mar 2010 21:56:45 +0200
> Subject: [PATCH] powernow-k8: Fix frequency reporting
>
> BugLink: http://bugs.launchpad.net/bugs/572348
>
> With F10, model 10, all valid frequencies are in the ACPI _PST table.
>
> Cc:<stable@kernel.org>  # 33.x 32.x
> Signed-off-by: Mark Langsdorf<mark.langsdorf@amd.com>
> LKML-Reference:<1270065406-1814-6-git-send-email-bp@amd64.org>
> Signed-off-by: Borislav Petkov<borislav.petkov@amd.com>
> Reviewed-by: Thomas Renninger<trenn@suse.de>
> Signed-off-by: H. Peter Anvin<hpa@zytor.com>
> Signed-off-by: Stefan Bader<stefan.bader@canonical.com>
> ---
>   arch/x86/kernel/cpu/cpufreq/powernow-k8.c |    3 ++-
>   1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
> index 52fce63..6f3dc8f 100644
> --- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
> +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
> @@ -935,7 +935,8 @@ static int fill_powernow_table_pstate(struct powernow_k8_data *data,
>   		powernow_table[i].index = index;
>
>   		/* Frequency may be rounded for these */
> -		if (boot_cpu_data.x86 == 0x10 || boot_cpu_data.x86 == 0x11) {
> +		if ((boot_cpu_data.x86 == 0x10&&  boot_cpu_data.x86_model<  10)
> +				 || boot_cpu_data.x86 == 0x11) {
>   			powernow_table[i].frequency =
>   				freq_from_fid_did(lo&  0x3f, (lo>>  6)&  7);
>   		} else

Acked-by: Tim Gardner <tim.gardner@canonical.com>
Colin King - May 3, 2010, 4:49 p.m.
On Fri, 2010-04-30 at 15:12 +0100, Stefan Bader wrote:
> SRU justification:
> 
> Impact: This has been reported through AMD. There is a bug in the
> frequency governor which prevents the P-states to be correctly set
> (no boost).
> 
> Fix: This fix has been queued up to linux-next and will be included in
> stable as well. To improve performance sooner we would be carrying this
> patch as pre-stable.
> 
> Testcase: Checking CPU frequencies the boost state without the patch
> will never be reached.
> 
> -Stefan
> 
> From 679370641e3675633cad222449262abbe93a4a2a Mon Sep 17 00:00:00 2001
> From: Mark Langsdorf <mark.langsdorf@amd.com>
> Date: Wed, 31 Mar 2010 21:56:45 +0200
> Subject: [PATCH] powernow-k8: Fix frequency reporting
> 
> BugLink: http://bugs.launchpad.net/bugs/572348
> 
> With F10, model 10, all valid frequencies are in the ACPI _PST table.
> 
> Cc: <stable@kernel.org> # 33.x 32.x
> Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>
> LKML-Reference: <1270065406-1814-6-git-send-email-bp@amd64.org>
> Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
> Reviewed-by: Thomas Renninger <trenn@suse.de>
> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
> ---
>  arch/x86/kernel/cpu/cpufreq/powernow-k8.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
> index 52fce63..6f3dc8f 100644
> --- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
> +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
> @@ -935,7 +935,8 @@ static int fill_powernow_table_pstate(struct powernow_k8_data *data,
>  		powernow_table[i].index = index;
>  
>  		/* Frequency may be rounded for these */
> -		if (boot_cpu_data.x86 == 0x10 || boot_cpu_data.x86 == 0x11) {
> +		if ((boot_cpu_data.x86 == 0x10 && boot_cpu_data.x86_model < 10)
> +				 || boot_cpu_data.x86 == 0x11) {
>  			powernow_table[i].frequency =
>  				freq_from_fid_did(lo & 0x3f, (lo >> 6) & 7);
>  		} else
> -- 
> 1.6.3.3
> 
> 
Looks sensible.

Acked-by: Colin King <colin.king@canonical.com>
Stefan Bader - May 7, 2010, 3:04 p.m.
Applied to Lucid master

Patch

diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
index 52fce63..6f3dc8f 100644
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
@@ -935,7 +935,8 @@  static int fill_powernow_table_pstate(struct powernow_k8_data *data,
 		powernow_table[i].index = index;
 
 		/* Frequency may be rounded for these */
-		if (boot_cpu_data.x86 == 0x10 || boot_cpu_data.x86 == 0x11) {
+		if ((boot_cpu_data.x86 == 0x10 && boot_cpu_data.x86_model < 10)
+				 || boot_cpu_data.x86 == 0x11) {
 			powernow_table[i].frequency =
 				freq_from_fid_did(lo & 0x3f, (lo >> 6) & 7);
 		} else