All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/smp: Fix Non-boot cpus cannot be bring up.
@ 2014-12-22  6:38 Dongsheng Wang
  2014-12-23  1:00 ` Michael Ellerman
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Dongsheng Wang @ 2014-12-22  6:38 UTC (permalink / raw)
  To: benh, scottwood, anton; +Cc: linuxppc-dev, Wang Dongsheng

From: Wang Dongsheng <dongsheng.wang@freescale.com>

Kernel cannot bring up Non-boot cpus always get "Processor xx is stuck".
this issue bring by http://patchwork.ozlabs.org/patch/418912/ (powerpc:
Secondary CPUs must set cpu_callin_map after setting active and online)
We need to take timebase after bootup cpu give the timebase firstly.

When start_secondary, non-boot cpus set cpu_callin_map for boot cpu
after that boot cpu will give the timebase for non-boot cpu. Otherwise
non-boot cpus will fall in dead loop to waiting bootup cpu to give
imebase.

Signed-off-by: Wang Dongsheng <dongsheng.wang@freescale.com>

diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 8ec017c..9e29836 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -703,10 +703,6 @@ void start_secondary(void *unused)
 
 	if (smp_ops->setup_cpu)
 		smp_ops->setup_cpu(cpu);
-	if (smp_ops->take_timebase)
-		smp_ops->take_timebase();
-
-	secondary_cpu_time_init();
 
 #ifdef CONFIG_PPC64
 	if (system_state == SYSTEM_RUNNING)
@@ -746,6 +742,16 @@ void start_secondary(void *unused)
 	smp_wmb();
 	cpu_callin_map[cpu] = 1;
 
+	/*
+	 * We need to take timebase after bootup cpu give the timebase.
+	 * Base on cpu_callin_map move to here, so we also need move
+	 * take_timebase. Because bootup cpu waiting for cpu_callin_map
+	 * be set after that give_timebase can be executed.
+	 */
+	if (smp_ops->take_timebase)
+		smp_ops->take_timebase();
+	secondary_cpu_time_init();
+
 	local_irq_enable();
 
 	cpu_startup_entry(CPUHP_ONLINE);
-- 
2.1.0.27.g96db324

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

end of thread, other threads:[~2014-12-29  9:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-22  6:38 [PATCH] powerpc/smp: Fix Non-boot cpus cannot be bring up Dongsheng Wang
2014-12-23  1:00 ` Michael Ellerman
2014-12-23  2:41   ` Dongsheng.Wang
2014-12-23  5:45     ` Michael Ellerman
2014-12-23  6:53       ` Dongsheng.Wang
2014-12-23  7:55       ` Dongsheng.Wang
2014-12-23  9:55   ` Benjamin Herrenschmidt
2014-12-26 12:09 ` Aaro Koskinen
2014-12-29  9:01 ` 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.