linux-csky.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] csky: Send stop IPI to send to online CPUs
@ 2021-01-05 15:24 Prarit Bhargava
  0 siblings, 0 replies; only message in thread
From: Prarit Bhargava @ 2021-01-05 15:24 UTC (permalink / raw)
  To: linux-csky; +Cc: Prarit Bhargava, Guo Ren

Unfortunately I do not have any HW to test this patch.  Hopefully someone on
the cc list can help me out?

P.

---8<---

This issue was noticed while debugging a shutdown issue where some
secondary CPUs are not being shutdown correctly.  A fix for that [1] requires
that secondary cpus be offlined using the cpu_online_mask so that the
stop operation is a no-op if CPU HOTPLUG is disabled.  I, like the author in
[1] looked at the architectures and found that csky is one of two
architectures that executes smp_send_stop() on all possible CPUs.

On csky, smp_send_stop() sends an IPI to all possible CPUs but only needs
to send them to online CPUs.

Send the stop IPI to only the online CPUs.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: Guo Ren <guoren@kernel.org>
---
 arch/csky/kernel/smp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/csky/kernel/smp.c b/arch/csky/kernel/smp.c
index 041d0de6a1b6..ee37586ba919 100644
--- a/arch/csky/kernel/smp.c
+++ b/arch/csky/kernel/smp.c
@@ -137,7 +137,7 @@ static void ipi_stop(void *unused)
 
 void smp_send_stop(void)
 {
-	on_each_cpu(ipi_stop, NULL, 1);
+	on_each_cpu_mask(cpu_online_mask, ipi_stop, NULL, 1);
 }
 
 void smp_send_reschedule(int cpu)
-- 
2.29.2


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

only message in thread, other threads:[~2021-01-05 15:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-05 15:24 [PATCH] csky: Send stop IPI to send to online CPUs Prarit Bhargava

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).