linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/64s: Fix DT CPU features Power9 DD2.1 logic
@ 2018-06-13 13:23 Michael Ellerman
  2018-06-13 14:31 ` Nicholas Piggin
  2018-06-19 23:21 ` Michael Ellerman
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Ellerman @ 2018-06-13 13:23 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: npiggin, paulus

In the device tree CPU features quirk code we want to set
CPU_FTR_POWER9_DD2_1 on all Power9s that aren't DD2.0 or earlier. But
we got the logic wrong and instead set it on all CPUs that aren't
Power9 DD2.0 or earlier, ie. including Power8.

Fix it by making sure we're on a Power9. This isn't a bug in practice
because the only code that checks the feature is Power9 only to begin
with. But we'll backport it anyway to avoid confusion.

Fixes: 9e9626ed3a4a ("powerpc/64s: Fix POWER9 DD2.2 and above in DT CPU features")
Cc: stable@vger.kernel.org # v4.17+
Reported-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/kernel/dt_cpu_ftrs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/dt_cpu_ftrs.c b/arch/powerpc/kernel/dt_cpu_ftrs.c
index 4be1c0de9406..96dd3d871986 100644
--- a/arch/powerpc/kernel/dt_cpu_ftrs.c
+++ b/arch/powerpc/kernel/dt_cpu_ftrs.c
@@ -711,7 +711,8 @@ static __init void cpufeatures_cpu_quirks(void)
 		cur_cpu_spec->cpu_features |= CPU_FTR_P9_TM_HV_ASSIST;
 		cur_cpu_spec->cpu_features |= CPU_FTR_P9_TM_XER_SO_BUG;
 		cur_cpu_spec->cpu_features |= CPU_FTR_POWER9_DD2_1;
-	} else /* DD2.1 and up have DD2_1 */
+	} else if ((version & 0xffff0000) == 0x004e0000)
+		/* DD2.1 and up have DD2_1 */
 		cur_cpu_spec->cpu_features |= CPU_FTR_POWER9_DD2_1;
 
 	if ((version & 0xffff0000) == 0x004e0000) {
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc/64s: Fix DT CPU features Power9 DD2.1 logic
  2018-06-13 13:23 [PATCH] powerpc/64s: Fix DT CPU features Power9 DD2.1 logic Michael Ellerman
@ 2018-06-13 14:31 ` Nicholas Piggin
  2018-06-19 23:21 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Nicholas Piggin @ 2018-06-13 14:31 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev, paulus

On Wed, 13 Jun 2018 23:23:56 +1000
Michael Ellerman <mpe@ellerman.id.au> wrote:

> In the device tree CPU features quirk code we want to set
> CPU_FTR_POWER9_DD2_1 on all Power9s that aren't DD2.0 or earlier. But
> we got the logic wrong and instead set it on all CPUs that aren't
> Power9 DD2.0 or earlier, ie. including Power8.
> 
> Fix it by making sure we're on a Power9. This isn't a bug in practice
> because the only code that checks the feature is Power9 only to begin
> with. But we'll backport it anyway to avoid confusion.
> 
> Fixes: 9e9626ed3a4a ("powerpc/64s: Fix POWER9 DD2.2 and above in DT CPU features")
> Cc: stable@vger.kernel.org # v4.17+
> Reported-by: Paul Mackerras <paulus@samba.org>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

Acked-by: Nicholas Piggin <npiggin@gmail.com>

> ---
>  arch/powerpc/kernel/dt_cpu_ftrs.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/kernel/dt_cpu_ftrs.c b/arch/powerpc/kernel/dt_cpu_ftrs.c
> index 4be1c0de9406..96dd3d871986 100644
> --- a/arch/powerpc/kernel/dt_cpu_ftrs.c
> +++ b/arch/powerpc/kernel/dt_cpu_ftrs.c
> @@ -711,7 +711,8 @@ static __init void cpufeatures_cpu_quirks(void)
>  		cur_cpu_spec->cpu_features |= CPU_FTR_P9_TM_HV_ASSIST;
>  		cur_cpu_spec->cpu_features |= CPU_FTR_P9_TM_XER_SO_BUG;
>  		cur_cpu_spec->cpu_features |= CPU_FTR_POWER9_DD2_1;
> -	} else /* DD2.1 and up have DD2_1 */
> +	} else if ((version & 0xffff0000) == 0x004e0000)
> +		/* DD2.1 and up have DD2_1 */
>  		cur_cpu_spec->cpu_features |= CPU_FTR_POWER9_DD2_1;
>  
>  	if ((version & 0xffff0000) == 0x004e0000) {

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: powerpc/64s: Fix DT CPU features Power9 DD2.1 logic
  2018-06-13 13:23 [PATCH] powerpc/64s: Fix DT CPU features Power9 DD2.1 logic Michael Ellerman
  2018-06-13 14:31 ` Nicholas Piggin
@ 2018-06-19 23:21 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2018-06-19 23:21 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev; +Cc: paulus, npiggin

On Wed, 2018-06-13 at 13:23:56 UTC, Michael Ellerman wrote:
> In the device tree CPU features quirk code we want to set
> CPU_FTR_POWER9_DD2_1 on all Power9s that aren't DD2.0 or earlier. But
> we got the logic wrong and instead set it on all CPUs that aren't
> Power9 DD2.0 or earlier, ie. including Power8.
> 
> Fix it by making sure we're on a Power9. This isn't a bug in practice
> because the only code that checks the feature is Power9 only to begin
> with. But we'll backport it anyway to avoid confusion.
> 
> Fixes: 9e9626ed3a4a ("powerpc/64s: Fix POWER9 DD2.2 and above in DT CPU features")
> Cc: stable@vger.kernel.org # v4.17+
> Reported-by: Paul Mackerras <paulus@samba.org>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> Acked-by: Nicholas Piggin <npiggin@gmail.com>

Applied to powerpc fixes.

https://git.kernel.org/powerpc/c/749a0278c2177b2d16da5d8b135ba7

cheers

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-06-19 23:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-13 13:23 [PATCH] powerpc/64s: Fix DT CPU features Power9 DD2.1 logic Michael Ellerman
2018-06-13 14:31 ` Nicholas Piggin
2018-06-19 23:21 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).