Skip to contentSkip to conversation

powerpc/powernv: Fix return value from power7_nap() et al.

PATCH New Paul Mackerras 1 participant 1 message Mar 19, 2015 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/powernv: Fix return value from power7_nap() et al.

The power7_nap(), power7_sleep() and power7_winkle() functions are called from pnv_smp_cpu_kill_self(), which expects them to return the SRR1 value set by the hardware on wakeup, or 0 if no nap/sleep/winkle occurred. However, in the case where an interrupt needs to be replayed, the logic in power7_powersave_common (the common code for power7_nap et al.) doesn't set r3 to 0 in this case. Instead what we get as the return value is the selector for the type of power-saving mode requested (1, 2 or 3). In fact this should not affect the operation of pnv_smp_cpu_kill_self(), but it is better to get this correct, so this adds an instruction to set r3 to 0 in this case.

---
 arch/powerpc/kernel/idle_power7.S | 1 +
 1 file changed, 1 insertion(+)
arch/powerpc/kernel/idle_power7.S +1 -0
index 05adc8b..eeaa0d5 100644
@@ -94,6 +94,7 @@ _GLOBAL(power7_powersave_common)
 	beq	1f
 	addi	r1,r1,INT_FRAME_SIZE
 	ld	r0,16(r1)
+	li	r3,0			/* Return 0 (no nap) */
 	mtlr	r0
 	blr
 
Signature · 1 line
2.1.4