Skip to contentSkip to conversation

csky: Send stop IPI to send to online CPUs

PATCH New Prarit Bhargava 1 participant 1 message Jan 5, 2021 C-sky architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 csky: Send stop IPI to send to online CPUs

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.

---
 arch/csky/kernel/smp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/csky/kernel/smp.c +1 -1
index 041d0de6a1b6..ee37586ba919 100644
@@ -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)
Signature · 1 line
2.29.2