diff mbox series

powerpc: Fix /proc/cpuinfo revision for POWER9P processors

Message ID 158161167949.29594.6467033073126346958.stgit@jupiter (mailing list archive)
State Deferred
Headers show
Series powerpc: Fix /proc/cpuinfo revision for POWER9P processors | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch powerpc/merge (a5bc6e124219546a81ce334dc9b16483d55e9abf)
snowpatch_ozlabs/build-ppc64le success Build succeeded
snowpatch_ozlabs/build-ppc64be success Build succeeded
snowpatch_ozlabs/build-ppc64e success Build succeeded
snowpatch_ozlabs/build-pmac32 success Build succeeded
snowpatch_ozlabs/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
snowpatch_ozlabs/needsstable success Patch has no Fixes tags

Commit Message

Mahesh J Salgaonkar Feb. 13, 2020, 4:34 p.m. UTC
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)

Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
---
 arch/powerpc/kernel/setup-common.c |    1 +
 1 file changed, 1 insertion(+)

Comments

Leonardo Bras Feb. 15, 2020, 6:23 a.m. UTC | #1
Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> writes:

Hello Mahesh,

> 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)
>
> Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
> ---
>  arch/powerpc/kernel/setup-common.c |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
> index 488f1eecc0de..37342ec42cb3 100644
> --- a/arch/powerpc/kernel/setup-common.c
> +++ b/arch/powerpc/kernel/setup-common.c
> @@ -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:
Reviwed-by: Leonardo Bras <leonardo@linux.ibm.com>
Leonardo Bras Feb. 17, 2020, 2:11 p.m. UTC | #2
On Sat, 2020-02-15 at 03:23 -0300, Leonardo Bras wrote:
> Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> writes:
> 
> Hello Mahesh,
> 
> > 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)
> > 
> > Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
> > ---
> >  arch/powerpc/kernel/setup-common.c |    1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
> > index 488f1eecc0de..37342ec42cb3 100644
> > --- a/arch/powerpc/kernel/setup-common.c
> > +++ b/arch/powerpc/kernel/setup-common.c
> > @@ -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:
> Reviwed-by: Leonardo Bras <leonardo@linux.ibm.com>

Sorry, typo.
Reviewed-by: Leonardo Bras <leonardo@linux.ibm.com>
diff mbox series

Patch

diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 488f1eecc0de..37342ec42cb3 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -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;