diff mbox

powernv: Clear SPRN_PSSCR when a POWER9 CPU comes online

Message ID 1479838000-380-1-git-send-email-ego@linux.vnet.ibm.com (mailing list archive)
State Accepted
Headers show

Commit Message

Gautham R Shenoy Nov. 22, 2016, 6:06 p.m. UTC
From: "Gautham R. Shenoy" <ego@linux.vnet.ibm.com>

Ensure that PSSCR is set to a safe value corresponding to no
state-loss each time a POWER9 CPU comes online.

Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
---
 arch/powerpc/kernel/cpu_setup_power.S | 2 ++
 1 file changed, 2 insertions(+)

Comments

Michael Ellerman Nov. 22, 2016, 11:30 p.m. UTC | #1
"Gautham R. Shenoy" <ego@linux.vnet.ibm.com> writes:

> From: "Gautham R. Shenoy" <ego@linux.vnet.ibm.com>
>
> Ensure that PSSCR is set to a safe value corresponding to no
> state-loss each time a POWER9 CPU comes online.

Is this a bug fix? I can't tell from the change log.

cheers
Michael Neuling Nov. 22, 2016, 11:35 p.m. UTC | #2
On Wed, 2016-11-23 at 10:30 +1100, Michael Ellerman wrote:
> "Gautham R. Shenoy" <ego@linux.vnet.ibm.com> writes:
> 
> > From: "Gautham R. Shenoy" <ego@linux.vnet.ibm.com>
> > 
> > Ensure that PSSCR is set to a safe value corresponding to no
> > state-loss each time a POWER9 CPU comes online.
> 
> Is this a bug fix? I can't tell from the change log.

There are no known bugs it's fixing.  

It's just safer to run with a known default value, rather than what we randomly
inherit from previous firmware.

Mikey
Michael Neuling Nov. 23, 2016, 12:32 a.m. UTC | #3
On Tue, 2016-11-22 at 23:36 +0530, Gautham R. Shenoy wrote:
> From: "Gautham R. Shenoy" <ego@linux.vnet.ibm.com>
> 
> Ensure that PSSCR is set to a safe value corresponding to no
> state-loss each time a POWER9 CPU comes online.
> 
> Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>

Tested here on my configuration... FWIW

Acked-By: Michael Neuling <mikey@neuling.org>

> ---
>  arch/powerpc/kernel/cpu_setup_power.S | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/powerpc/kernel/cpu_setup_power.S
> b/arch/powerpc/kernel/cpu_setup_power.S
> index 52ff3f0..37ad045 100644
> --- a/arch/powerpc/kernel/cpu_setup_power.S
> +++ b/arch/powerpc/kernel/cpu_setup_power.S
> @@ -96,6 +96,7 @@ _GLOBAL(__setup_cpu_power9)
>  	mtlr	r11
>  	beqlr
>  	li	r0,0
> +	mtspr	SPRN_PSSCR,r0
>  	mtspr	SPRN_LPID,r0
>  	mfspr	r3,SPRN_LPCR
>  	ori	r3, r3, LPCR_PECEDH
> @@ -116,6 +117,7 @@ _GLOBAL(__restore_cpu_power9)
>  	mtlr	r11
>  	beqlr
>  	li	r0,0
> +	mtspr	SPRN_PSSCR,r0
>  	mtspr	SPRN_LPID,r0
>  	mfspr   r3,SPRN_LPCR
>  	ori	r3, r3, LPCR_PECEDH
Michael Ellerman Nov. 28, 2016, 12:15 p.m. UTC | #4
On Tue, 2016-11-22 at 18:06:40 UTC, "Gautham R. Shenoy" wrote:
> From: "Gautham R. Shenoy" <ego@linux.vnet.ibm.com>
> 
> Ensure that PSSCR is set to a safe value corresponding to no
> state-loss each time a POWER9 CPU comes online.
> 
> Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
> Acked-By: Michael Neuling <mikey@neuling.org>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/378f96d3cd442d5cb8e2692d8767a4

cheers
diff mbox

Patch

diff --git a/arch/powerpc/kernel/cpu_setup_power.S b/arch/powerpc/kernel/cpu_setup_power.S
index 52ff3f0..37ad045 100644
--- a/arch/powerpc/kernel/cpu_setup_power.S
+++ b/arch/powerpc/kernel/cpu_setup_power.S
@@ -96,6 +96,7 @@  _GLOBAL(__setup_cpu_power9)
 	mtlr	r11
 	beqlr
 	li	r0,0
+	mtspr	SPRN_PSSCR,r0
 	mtspr	SPRN_LPID,r0
 	mfspr	r3,SPRN_LPCR
 	ori	r3, r3, LPCR_PECEDH
@@ -116,6 +117,7 @@  _GLOBAL(__restore_cpu_power9)
 	mtlr	r11
 	beqlr
 	li	r0,0
+	mtspr	SPRN_PSSCR,r0
 	mtspr	SPRN_LPID,r0
 	mfspr   r3,SPRN_LPCR
 	ori	r3, r3, LPCR_PECEDH