powerpc: Fix determining TI_CPU in power_save_ppc32_restore()
PATCH v2 1/1 powerpc: Fix determining TI_CPU in power_save_ppc32_restore()
The calculation to get TI_CPU based off of SPRG3 was just plain wrong. 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 <[email protected]>
---
The first version was just brain damaged. This version should be cleaner and doesn't assume anything about the call site having r9 setup already.
(updated for-2.6.27 w/this and rebased to top of linus).
- k
arch/powerpc/kernel/idle_6xx.S | 3 ++- arch/powerpc/kernel/idle_e500.S | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
arch/powerpc/kernel/idle_6xx.S +2 -1
@@ -158,7 +158,8 @@ _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 + tophys(r12,r12) /* check local flags */ lwz r11,TI_CPU(r12) /* get cpu number * 4 */ slwi r11,r11,2 #else
arch/powerpc/kernel/idle_e500.S +2 -1
@@ -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
Signature · 1 line
1.5.5.1
Quoted 7 lines · Kumar Gala
The calculation to get
TI_CPUbased off of SPRG3 was just plain wrong. Just offset off the stack pointer (to get tothread_info) like all the other references toTI_CPUdo.This was pointed out by Chen Gong <[email protected]>
Signed-off-by Kumar Gala <[email protected]>
Quoted 10 lines · Benjamin Herrenschmidt
Quoted 7 lines · Kumar Gala
The calculation to get
TI_CPUbased off of SPRG3 was just plain wrong. Just offset off the stack pointer (to get tothread_info) like all the other references toTI_CPUdo.This was pointed out by Chen Gong <[email protected]>
Signed-off-by Kumar Gala <[email protected]>
Paul, you picking this up for 2.6.27?
- k