Skip to contentSkip to conversation

powerpc/powernv/idle: Fix restore of SPRN_LDBAR for POWER9 stop state.

PATCH Applied Madhavan Srinivasan 3 participants 3 messages Jul 2, 2019 – Jul 15, 2019 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/powernv/idle: Fix restore of SPRN_LDBAR for POWER9 stop state.

From: Athira Rajeev <[email protected]>

commit 10d91611f426 ("powerpc/64s: Reimplement book3s idle code in C") reimplemented book3S code to pltform/powernv/idle.c. But when doing so missed to add the per-thread LDBAR update in the core_woken path of the power9_idle_stop(). Patch fixes the same.

Fixes 10d91611f426 ("powerpc/64s: Reimplement book3s idle code in C")
---
 arch/powerpc/platforms/powernv/idle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/platforms/powernv/idle.c +1 -1
index 2f4479b94ac3..fd14a6237954 100644
@@ -758,7 +758,6 @@ static unsigned long power9_idle_stop(unsigned long psscr, bool mmu_on)
 	mtspr(SPRN_PTCR,	sprs.ptcr);
 	mtspr(SPRN_RPR,		sprs.rpr);
 	mtspr(SPRN_TSCR,	sprs.tscr);
-	mtspr(SPRN_LDBAR,	sprs.ldbar);
 
 	if (pls >= pnv_first_tb_loss_level) {
 		/* TB loss */
@@ -790,6 +789,7 @@ static unsigned long power9_idle_stop(unsigned long psscr, bool mmu_on)
 	mtspr(SPRN_MMCR0,	sprs.mmcr0);
 	mtspr(SPRN_MMCR1,	sprs.mmcr1);
 	mtspr(SPRN_MMCR2,	sprs.mmcr2);
+	mtspr(SPRN_LDBAR,	sprs.ldbar);
 
 	mtspr(SPRN_SPRG3,	local_paca->sprg_vdso);
 
Signature · 1 line
2.20.1
reviewer Reviewed-by on v1 1/1
#1 lore raw

Madhavan Srinivasan's on July 2, 2019 8:58 pm:

Quoted 27 lines

From: Athira Rajeev <[email protected]>

commit 10d91611f426 ("powerpc/64s: Reimplement book3s idle code in C") reimplemented book3S code to pltform/powernv/idle.c. But when doing so missed to add the per-thread LDBAR update in the core_woken path of the power9_idle_stop(). Patch fixes the same.

Fixes 10d91611f426 ("powerpc/64s: Reimplement book3s idle code in C")
---
 arch/powerpc/platforms/powernv/idle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/platforms/powernv/idle.c +0 -1
index 2f4479b94ac3..fd14a6237954 100644
@@ -758,7 +758,6 @@ static unsigned long power9_idle_stop(unsigned long psscr, bool mmu_on)
 	mtspr(SPRN_PTCR,	sprs.ptcr);
 	mtspr(SPRN_RPR,		sprs.rpr);
 	mtspr(SPRN_TSCR,	sprs.tscr);
-	mtspr(SPRN_LDBAR,	sprs.ldbar);
 
 	if (pls >= pnv_first_tb_loss_level) {
 		/* TB loss */

arch/powerpc/platforms/powernv/idle.c static unsigned long power9_idle_stop(unsigned long psscr, bool mmu_on) · line 792

Quoted 4 lines
arch/powerpc/platforms/powernv/idle.c +1 -0
@@ -790,6 +789,7 @@ static unsigned long power9_idle_stop(unsigned long psscr, bool mmu_on)
 	mtspr(SPRN_MMCR0,	sprs.mmcr0);
 	mtspr(SPRN_MMCR1,	sprs.mmcr1);
 	mtspr(SPRN_MMCR2,	sprs.mmcr2);
+	mtspr(SPRN_LDBAR,	sprs.ldbar);

Oh that's another one I messed up, thanks for the fix. I must have confused myself with the SPR table in the UM :(

#2 lore raw
In reply to Madhavan Srinivasan
Quoted 11 lines · Madhavan Srinivasan

From: Athira Rajeev <[email protected]>

commit 10d91611f426 ("powerpc/64s: Reimplement book3s idle code in C") reimplemented book3S code to pltform/powernv/idle.c. But when doing so missed to add the per-thread LDBAR update in the core_woken path of the power9_idle_stop(). Patch fixes the same.

Fixes 10d91611f426 ("powerpc/64s: Reimplement book3s idle code in C")

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/f5a9e488d62360c91c5770bd55a0b40e419a71ce

cheers