Commit 7888bc2b authored by Kumar Gala's avatar Kumar Gala Committed by Paul Mackerras

powerpc: Fix for getting CPU number in power_save_ppc32_restore()

The calculation to get TI_CPU based off of SPRG3 was just plain wrong,
meaning that we were getting garbage for the CPU number on 6xx/G3/G4
based SMP boxes in this code.

Just offset off the stack pointer (to get to thread_info) like all the
other references to TI_CPU do.

This was pointed out by Chen Gong <G.Chen@freescale.com>

[paulus@samba.org - use rlwinm r12,r11,... instead of
 rlwinm r12,r1,...; tophys()]
Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
Acked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 94ee815c
......@@ -158,7 +158,7 @@ _GLOBAL(power_save_ppc32_restore)
stw r9,_NIP(r11) /* make it do a blr */
#ifdef CONFIG_SMP
mfspr r12,SPRN_SPRG3
rlwinm r12,r11,0,0,31-THREAD_SHIFT
lwz r11,TI_CPU(r12) /* get cpu number * 4 */
slwi r11,r11,2
#else
......
......@@ -84,10 +84,11 @@ _GLOBAL(power_save_ppc32_restore)
stw r9,_NIP(r11) /* make it do a blr */
#ifdef CONFIG_SMP
mfspr r12,SPRN_SPRG3
rlwinm r12,r1,0,0,31-THREAD_SHIFT
lwz r11,TI_CPU(r12) /* get cpu number * 4 */
slwi r11,r11,2
#else
li r11,0
#endif
b transfer_to_handler_cont
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment