Skip to contentSkip to conversation

powerpc: stop_this_cpu: remove the cpu from the online map.

PATCH In review Valentine Barshak 1 participant 2 messages Nov 25, 2009 – Dec 7, 2009 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: stop_this_cpu: remove the cpu from the online map.

Remove the CPU from the online map to prevent smp_call_function from sending messages to a stopped CPU.

---
 arch/powerpc/kernel/smp.c |    3 +++
 1 file changed, 3 insertions(+)
arch/powerpc/kernel/smp.c +3 -0
diff -pruN linux-2.6.orig/arch/powerpc/kernel/smp.c linux-2.6/arch/powerpc/kernel/smp.c
@@ -218,6 +218,9 @@ void crash_send_ipi(void (*crash_ipi_cal
 
 static void stop_this_cpu(void *dummy)
 {
+	/* Remove this CPU */
+	set_cpu_online(smp_processor_id(), false);
+
 	local_irq_disable();
 	while (1)
 		;
author
#1 lore raw

Ben, is this OK?
Other architectures do the same thing.

Thanks,
Val.

Quoted 25 lines · Valentine Barshak

Remove the CPU from the online map to prevent smp_call_function from sending messages to a stopped CPU.

---
 arch/powerpc/kernel/smp.c |    3 +++
 1 file changed, 3 insertions(+)

diff -pruN linux-2.6.orig/arch/powerpc/kernel/smp.c linux-2.6/arch/powerpc/kernel/smp.c

arch/powerpc/kernel/smp.c +3 -0
@@ -218,6 +218,9 @@ void crash_send_ipi(void (*crash_ipi_cal
 
 static void stop_this_cpu(void *dummy)
 {
+	/* Remove this CPU */
+	set_cpu_online(smp_processor_id(), false);
+
 	local_irq_disable();
 	while (1)
 		;

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev