Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ppc/powernv: Set the runlatch bits correctly for offline cpus

Up until now we have been setting the runlatch bits for a busy CPU and
clearing it when a CPU enters idle state. The runlatch bit has thus
been consistent with the utilization of a CPU as long as the CPU is online.

However when a CPU is hotplugged out the runlatch bit is not cleared. It
needs to be cleared to indicate an unused CPU. Hence this patch has the
runlatch bit cleared for an offline CPU just before entering an idle state
and sets it immediately after it exits the idle state.

Signed-off-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Acked-by: Paul Mackerras <paulus@samba.org>
Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

Preeti U Murthy and committed by
Benjamin Herrenschmidt
f2038911 42dbfc86

+3
+3
arch/powerpc/platforms/powernv/smp.c
··· 30 30 #include <asm/cputhreads.h> 31 31 #include <asm/xics.h> 32 32 #include <asm/opal.h> 33 + #include <asm/runlatch.h> 33 34 34 35 #include "powernv.h" 35 36 ··· 157 156 */ 158 157 mtspr(SPRN_LPCR, mfspr(SPRN_LPCR) & ~(u64)LPCR_PECE1); 159 158 while (!generic_check_cpu_restart(cpu)) { 159 + ppc64_runlatch_off(); 160 160 power7_nap(); 161 + ppc64_runlatch_on(); 161 162 if (!generic_check_cpu_restart(cpu)) { 162 163 DBG("CPU%d Unexpected exit while offline !\n", cpu); 163 164 /* We may be getting an IPI, so we re-enable