From: Joel Schopp On Power4 and earlier hardware there is no need to clear the CPPR (see RPAp 479 section 18.5.4.7.2 for what little info there is on the CPPR) when stopping a cpu. On hardware that uses Power5 an undocumented change has been made that requires the CPPR to be cleared if an isolate is to be done on the stopped cpu. So the following patch lets cpu hotplug work on the recent hardware. I sent this patch to the ppc64-dev list back in mid April and Suse picked it up then for SLES9 so it has been well tested for several months. Signed-off-by: Andrew Morton --- 25-akpm/arch/ppc64/kernel/smp.c | 4 ++++ 25-akpm/arch/ppc64/kernel/xics.c | 2 +- 25-akpm/include/asm-ppc64/xics.h | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff -puN arch/ppc64/kernel/smp.c~ppc64-cpu-hotplug-fix arch/ppc64/kernel/smp.c --- 25/arch/ppc64/kernel/smp.c~ppc64-cpu-hotplug-fix 2004-07-26 16:44:10.191403848 -0700 +++ 25-akpm/arch/ppc64/kernel/smp.c 2004-07-26 16:44:10.198402784 -0700 @@ -300,6 +300,10 @@ void __cpu_die(unsigned int cpu) void cpu_die(void) { local_irq_disable(); + /* Some hardware requires clearing the CPPR, while other hardware does not + * it is safe either way + */ + pSeriesLP_cppr_info(0, 0); rtas_stop_self(); /* Should never get here... */ BUG(); diff -puN arch/ppc64/kernel/xics.c~ppc64-cpu-hotplug-fix arch/ppc64/kernel/xics.c --- 25/arch/ppc64/kernel/xics.c~ppc64-cpu-hotplug-fix 2004-07-26 16:44:10.192403696 -0700 +++ 25-akpm/arch/ppc64/kernel/xics.c 2004-07-26 16:44:10.199402632 -0700 @@ -190,7 +190,7 @@ static void pSeriesLP_xirr_info_set(int val64); } -static void pSeriesLP_cppr_info(int n_cpu, u8 value) +void pSeriesLP_cppr_info(int n_cpu, u8 value) { unsigned long lpar_rc; diff -puN include/asm-ppc64/xics.h~ppc64-cpu-hotplug-fix include/asm-ppc64/xics.h --- 25/include/asm-ppc64/xics.h~ppc64-cpu-hotplug-fix 2004-07-26 16:44:10.194403392 -0700 +++ 25-akpm/include/asm-ppc64/xics.h 2004-07-26 16:44:10.199402632 -0700 @@ -19,6 +19,9 @@ int xics_get_irq(struct pt_regs *); void xics_setup_cpu(void); void xics_cause_IPI(int cpu); +/* first argument is ignored for now*/ +void pSeriesLP_cppr_info(int n_cpu, u8 value); + struct xics_ipi_struct { volatile unsigned long value; } ____cacheline_aligned; _