ARM: smp: Switch to hotplug core state synchronization
authorThomas Gleixner <tglx@linutronix.de>
Fri, 12 May 2023 21:07:32 +0000 (23:07 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 15 May 2023 11:44:57 +0000 (13:44 +0200)
Switch to the CPU hotplug core state tracking and synchronization
mechanim. No functional change intended.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Michael Kelley <mikelley@microsoft.com>
Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Tested-by: Helge Deller <deller@gmx.de> # parisc
Tested-by: Guilherme G. Piccoli <gpiccoli@igalia.com> # Steam Deck
Link: https://lore.kernel.org/r/20230512205256.635326070@linutronix.de
arch/arm/Kconfig
arch/arm/include/asm/smp.h
arch/arm/kernel/smp.c

index 0fb4b218f6658b72f659bd7952099371886363f0..775ce86507d7bdc4e71de8a0d9919b5ed6ef5db4 100644 (file)
@@ -124,6 +124,7 @@ config ARM
        select HAVE_SYSCALL_TRACEPOINTS
        select HAVE_UID16
        select HAVE_VIRT_CPU_ACCOUNTING_GEN
+       select HOTPLUG_CORE_SYNC_DEAD if HOTPLUG_CPU
        select IRQ_FORCED_THREADING
        select MODULES_USE_ELF_REL
        select NEED_DMA_MAP_STATE
index 7c1c90d9f582759c8f4d152a144996ab7379743b..8c05a7f374d8b3d69d51e0d8dc11ceaea5611069 100644 (file)
@@ -64,7 +64,7 @@ extern void secondary_startup_arm(void);
 
 extern int __cpu_disable(void);
 
-extern void __cpu_die(unsigned int cpu);
+static inline void __cpu_die(unsigned int cpu) { }
 
 extern void arch_send_call_function_single_ipi(int cpu);
 extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
index 87f8d0e5e314a87acbae464484c5d565f2874018..6756203e45f3d0b7780d2144ab21a0a80e048883 100644 (file)
@@ -288,15 +288,11 @@ int __cpu_disable(void)
 }
 
 /*
- * called on the thread which is asking for a CPU to be shutdown -
- * waits until shutdown has completed, or it is timed out.
+ * called on the thread which is asking for a CPU to be shutdown after the
+ * shutdown completed.
  */
-void __cpu_die(unsigned int cpu)
+void arch_cpuhp_cleanup_dead_cpu(unsigned int cpu)
 {
-       if (!cpu_wait_death(cpu, 5)) {
-               pr_err("CPU%u: cpu didn't die\n", cpu);
-               return;
-       }
        pr_debug("CPU%u: shutdown\n", cpu);
 
        clear_tasks_mm_cpumask(cpu);
@@ -336,11 +332,11 @@ void __noreturn arch_cpu_idle_dead(void)
        flush_cache_louis();
 
        /*
-        * Tell __cpu_die() that this CPU is now safe to dispose of.  Once
-        * this returns, power and/or clocks can be removed at any point
-        * from this CPU and its cache by platform_cpu_kill().
+        * Tell cpuhp_bp_sync_dead() that this CPU is now safe to dispose
+        * of. Once this returns, power and/or clocks can be removed at
+        * any point from this CPU and its cache by platform_cpu_kill().
         */
-       (void)cpu_report_death();
+       cpuhp_ap_report_dead();
 
        /*
         * Ensure that the cache lines associated with that completion are