[PATCH v2 34/45] hexagon/smp: Use get/put_online_cpus_atomic() to prevent CPU offline

From
Srivatsa S. Bhat <hidden>
Date
2013-06-25 20:35:32
Also in
linux-arch, linux-pm, lkml, netdev
Reply to
Srivatsa S. Bhat, 2013-06-25
Once stop_machine() is gone from the CPU offline path, we won't be able
to depend on disabling preemption to prevent CPUs from going offline
from under us.

Use the get/put_online_cpus_atomic() APIs to prevent CPUs from going
offline, while invoking from atomic context.

Cc: Richard Kuo <redacted>
Cc: Thomas Gleixner <redacted>
Cc: <redacted>
Signed-off-by: Srivatsa S. Bhat <redacted>
---

 arch/hexagon/kernel/smp.c |    3 +++
 1 file changed, 3 insertions(+)
diff --git a/arch/hexagon/kernel/smp.c b/arch/hexagon/kernel/smp.c
index 0e364ca..30d4318 100644
--- a/arch/hexagon/kernel/smp.c
+++ b/arch/hexagon/kernel/smp.c
@@ -241,9 +241,12 @@ void smp_send_reschedule(int cpu)
 void smp_send_stop(void)
 {
 	struct cpumask targets;
+
+	get_online_cpus_atomic();
 	cpumask_copy(&targets, cpu_online_mask);
 	cpumask_clear_cpu(smp_processor_id(), &targets);
 	send_ipi(&targets, IPI_CPU_STOP);
+	put_online_cpus_atomic();
 }
 
 void arch_send_call_function_single_ipi(int cpu)
Thread (72 messages) 72 messages, 8 authors, last reply 2013-06-27
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help