linux-hexagon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 34/45] hexagon/smp: Use get/put_online_cpus_atomic() to prevent CPU offline
       [not found] <20130625202452.16593.22810.stgit@srivatsabhat.in.ibm.com>
@ 2013-06-25 20:32 ` Srivatsa S. Bhat
  0 siblings, 0 replies; only message in thread
From: Srivatsa S. Bhat @ 2013-06-25 20:32 UTC (permalink / raw)
  To: tglx, peterz, tj, oleg, paulmck, rusty, mingo, akpm, namhyung,
	walken, vincent.guittot, laijs
  Cc: rostedt, wangyun, xiaoguangrong, sbw, fweisbec, zhong, nikunj,
	srivatsa.bhat, linux-pm, linux-arch, linuxppc-dev, netdev,
	linux-kernel, Richard Kuo, Thomas Gleixner, linux-hexagon,
	Srivatsa S. Bhat

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 <rkuo@codeaurora.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-hexagon@vger.kernel.org
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
---

 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)


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-06-25 20:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20130625202452.16593.22810.stgit@srivatsabhat.in.ibm.com>
2013-06-25 20:32 ` [PATCH v2 34/45] hexagon/smp: Use get/put_online_cpus_atomic() to prevent CPU offline Srivatsa S. Bhat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).