Skip to contentSkip to conversation

powerpc: Fix /proc/cpuinfo revision for POWER9P processors

PATCH In review Mahesh Salgaonkar 2 participants 3 messages Feb 13, 2020 – Feb 17, 2020 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: Fix /proc/cpuinfo revision for POWER9P processors

POWER9P PVR bits are same as that of POWER9. Hence mask off only the relevant bits for the major revision similar to POWER9.

Without this patch the cpuinfo output shows 17.0 as revision:

$ cat /proc/cpuinfo
processor	: 0
cpu		: POWER9P, altivec supported
clock		: 2950.000000MHz
revision	: 17.0 (pvr 004f 1100)

With this change it reflects the correct revision:

$ cat /proc/cpuinfo
processor	: 0
cpu		: POWER9P, altivec supported
clock		: 2633.000000MHz
revision	: 1.0 (pvr 004f 1100)
---
 arch/powerpc/kernel/setup-common.c |    1 +
 1 file changed, 1 insertion(+)
arch/powerpc/kernel/setup-common.c +1 -0
index 488f1eecc0de..37342ec42cb3 100644
@@ -315,6 +315,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 				min = pvr & 0xFF;
 				break;
 			case 0x004e: /* POWER9 bits 12-15 give chip type */
+			case 0x004f: /* POWER9P bits 12-15 give chip type */
 				maj = (pvr >> 8) & 0x0F;
 				min = pvr & 0xFF;
 				break;
#1 lore raw

Mahesh Salgaonkar <[email protected]> writes:

Hello Mahesh,

Quoted 29 lines

POWER9P PVR bits are same as that of POWER9. Hence mask off only the relevant bits for the major revision similar to POWER9.

Without this patch the cpuinfo output shows 17.0 as revision:

$ cat /proc/cpuinfo
processor     : 0
cpu           : POWER9P, altivec supported
clock         : 2950.000000MHz
revision      : 17.0 (pvr 004f 1100)

With this change it reflects the correct revision:

$ cat /proc/cpuinfo
processor     : 0
cpu           : POWER9P, altivec supported
clock         : 2633.000000MHz
revision      : 1.0 (pvr 004f 1100)
---
 arch/powerpc/kernel/setup-common.c |    1 +
 1 file changed, 1 insertion(+)
arch/powerpc/kernel/setup-common.c +0 -0
index 488f1eecc0de..37342ec42cb3 100644

arch/powerpc/kernel/setup-common.c static int show_cpuinfo(struct seq_file *m, void *v) · line 321

Quoted 7 lines
arch/powerpc/kernel/setup-common.c +1 -0
@@ -315,6 +315,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
                              min = pvr & 0xFF;
                              break;
                      case 0x004e: /* POWER9 bits 12-15 give chip type */
+                     case 0x004f: /* POWER9P bits 12-15 give chip type */
                              maj = (pvr >> 8) & 0x0F;
                              min = pvr & 0xFF;
                              break;

Seems fine to me.

FWIW:

Reviewed-by
#2 lore raw
Quoted 43 lines · Leonardo Bras

Mahesh Salgaonkar <[email protected]> writes:

Hello Mahesh,

Quoted 29 lines

POWER9P PVR bits are same as that of POWER9. Hence mask off only the relevant bits for the major revision similar to POWER9.

Without this patch the cpuinfo output shows 17.0 as revision:

$ cat /proc/cpuinfo
processor     : 0
cpu           : POWER9P, altivec supported
clock         : 2950.000000MHz
revision      : 17.0 (pvr 004f 1100)

With this change it reflects the correct revision:

$ cat /proc/cpuinfo
processor     : 0
cpu           : POWER9P, altivec supported
clock         : 2633.000000MHz
revision      : 1.0 (pvr 004f 1100)
---
 arch/powerpc/kernel/setup-common.c |    1 +
 1 file changed, 1 insertion(+)
arch/powerpc/kernel/setup-common.c +0 -0
index 488f1eecc0de..37342ec42cb3 100644

arch/powerpc/kernel/setup-common.c static int show_cpuinfo(struct seq_file *m, void *v) · line 321

Quoted 7 lines
arch/powerpc/kernel/setup-common.c +1 -0
@@ -315,6 +315,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
                              min = pvr & 0xFF;
                              break;
                      case 0x004e: /* POWER9 bits 12-15 give chip type */
+                     case 0x004f: /* POWER9P bits 12-15 give chip type */
                              maj = (pvr >> 8) & 0x0F;
                              min = pvr & 0xFF;
                              break;

Seems fine to me.

Quoted 2 lines

FWIW:

Sorry, typo.