diff mbox

[Zesty] SAUCE: powerpc: Fix /proc/cpuinfo revision for POWER9 DD2

Message ID 1497884332-12384-1-git-send-email-leitao@debian.org
State New
Headers show

Commit Message

Breno Leitao June 19, 2017, 2:58 p.m. UTC
From: Michael Neuling <mikey@neuling.org>

BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1698844

The P9 PVR bits 12-15 don't indicate a revision but instead different
chip configurations.  From BookIV we have:
   Bits      Configuration
    0 :    Scale out 12 cores
    1 :    Scale out 24 cores
    2 :    Scale up  12 cores
    3 :    Scale up  24 cores

DD1 doesn't use this but DD2 does. Linux will mostly use the "Scale
out 24 core" configuration (ie. SMT4 not SMT8) which results in a PVR
of 0x004e1200. The reported revision in /proc/cpuinfo is hence
reported incorrectly as "18.0".

This patch fixes this to mask off only the relevant bits for the major
revision (ie. bits 8-11) for POWER9.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Breno Leitao <leitao@debian.org>
---
 arch/powerpc/kernel/setup-common.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Marcelo Henrique Cerri June 19, 2017, 8:30 p.m. UTC | #1

Seth Forshee June 20, 2017, 1:12 p.m. UTC | #2
On Mon, Jun 19, 2017 at 11:58:52AM -0300, Breno Leitao wrote:
> From: Michael Neuling <mikey@neuling.org>
> 
> BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1698844
> 
> The P9 PVR bits 12-15 don't indicate a revision but instead different
> chip configurations.  From BookIV we have:
>    Bits      Configuration
>     0 :    Scale out 12 cores
>     1 :    Scale out 24 cores
>     2 :    Scale up  12 cores
>     3 :    Scale up  24 cores
> 
> DD1 doesn't use this but DD2 does. Linux will mostly use the "Scale
> out 24 core" configuration (ie. SMT4 not SMT8) which results in a PVR
> of 0x004e1200. The reported revision in /proc/cpuinfo is hence
> reported incorrectly as "18.0".
> 
> This patch fixes this to mask off only the relevant bits for the major
> revision (ie. bits 8-11) for POWER9.
> 
> Signed-off-by: Michael Neuling <mikey@neuling.org>
> Signed-off-by: Breno Leitao <leitao@debian.org>

One small nit, the subject should start with "UBUNTU: SAUCE:" for sauce
patches and not just "SAUCE:". But that can be fixed when applied.

Acked-by: Seth Forshee <seth.forshee@canonical.com>

Also applied to artful/master-next.
Stefan Bader June 21, 2017, 10:42 a.m. UTC | #3
Applied to Zesty master-next.

Thanks,
-Stefan
diff mbox

Patch

diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 4df19cde846c..d07cdc6c1ba1 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -322,6 +322,10 @@  static int show_cpuinfo(struct seq_file *m, void *v)
 				maj = ((pvr >> 8) & 0xFF) - 1;
 				min = pvr & 0xFF;
 				break;
+			case 0x004e: /* POWER9 bits 12-15 give chip type */
+				maj = (pvr >> 8) & 0x0F;
+				min = pvr & 0xFF;
+				break;
 			default:
 				maj = (pvr >> 8) & 0xFF;
 				min = pvr & 0xFF;