All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] powerpc: Move arch_cpu_idle_dead() into smp.c
@ 2020-08-19  1:56 Michael Ellerman
  2020-08-19  1:56 ` [PATCH 2/3] powerpc/smp: Fold cpu_die() into its only caller Michael Ellerman
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Michael Ellerman @ 2020-08-19  1:56 UTC (permalink / raw)
  To: linuxppc-dev

arch_cpu_idle_dead() is in idle.c, which makes sense, but it's inside
a CONFIG_HOTPLUG_CPU block.

It would be more at home in smp.c, inside the existing
CONFIG_HOTPLUG_CPU block. Note that CONFIG_HOTPLUG_CPU depends on
CONFIG_SMP so even though smp.c is not built for SMP=n builds, that's
fine.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/kernel/idle.c | 8 --------
 arch/powerpc/kernel/smp.c  | 6 ++++++
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/kernel/idle.c b/arch/powerpc/kernel/idle.c
index 422e31d2f5a2..ae0e2632393d 100644
--- a/arch/powerpc/kernel/idle.c
+++ b/arch/powerpc/kernel/idle.c
@@ -41,14 +41,6 @@ static int __init powersave_off(char *arg)
 }
 __setup("powersave=off", powersave_off);
 
-#ifdef CONFIG_HOTPLUG_CPU
-void arch_cpu_idle_dead(void)
-{
-	sched_preempt_enable_no_resched();
-	cpu_die();
-}
-#endif
-
 void arch_cpu_idle(void)
 {
 	ppc64_runlatch_off();
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 8261999c7d52..b05d2db13d08 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -1429,6 +1429,12 @@ void __cpu_die(unsigned int cpu)
 		smp_ops->cpu_die(cpu);
 }
 
+void arch_cpu_idle_dead(void)
+{
+	sched_preempt_enable_no_resched();
+	cpu_die();
+}
+
 void cpu_die(void)
 {
 	/*
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-24 12:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-19  1:56 [PATCH 1/3] powerpc: Move arch_cpu_idle_dead() into smp.c Michael Ellerman
2020-08-19  1:56 ` [PATCH 2/3] powerpc/smp: Fold cpu_die() into its only caller Michael Ellerman
2020-08-19  1:56 ` [PATCH 3/3] powerpc/smp: Move ppc_md.cpu_die() to smp_ops.cpu_offline_self() Michael Ellerman
2020-08-19  6:44   ` Christophe Leroy
2020-09-24 12:27 ` [PATCH 1/3] powerpc: Move arch_cpu_idle_dead() into smp.c Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.