Skip to contentSkip to conversation

arm64: Use PSCI calls for CPU stop when hotplug is supported

RFC PATCH New Pramod Kumar 1 participant 1 message Jan 18, 2019 arm64

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 arm64: Use PSCI calls for CPU stop when hotplug is supported

If CPU hotplug is supported, ipi_cpu_stop should use PSCI cpudie call to stop the CPU. This call ensures L1/L2 cache flush, CPUs cache-cohenrecy setting w.r.to interconnect.

Apart from this, this gives control to f/w to reduce power consumption by take appropriate decesion on power rails for plugging-out core.

---
 arch/arm64/kernel/smp.c | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/kernel/smp.c +5 -0
index 1598d6f..360e52b 100644
@@ -822,8 +822,13 @@ static void ipi_cpu_stop(unsigned int cpu)
 	local_daif_mask();
 	sdei_mask_local_cpu();
 
+#ifdef CONFIG_HOTPLUG_CPU
+	if (cpu_ops[cpu]->cpu_die)
+		cpu_ops[cpu]->cpu_die(cpu);
+#else
 	while (1)
 		cpu_relax();
+#endif
 }
 
 #ifdef CONFIG_KEXEC_CORE
Signature · 1 line
1.9.1