LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dongsheng Wang <dongsheng.wang@freescale.com>
To: <benh@kernel.crashing.org>, <scottwood@freescale.com>, <anton@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org,
	Wang Dongsheng <dongsheng.wang@freescale.com>
Subject: [PATCH] powerpc/smp: Fix Non-boot cpus cannot be bring up.
Date: Mon, 22 Dec 2014 14:38:40 +0800	[thread overview]
Message-ID: <1419230320-37558-1-git-send-email-dongsheng.wang@freescale.com> (raw)

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

             reply	other threads:[~2014-12-22  9:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-22  6:38 Dongsheng Wang [this message]
2014-12-23  1:00 ` [PATCH] powerpc/smp: Fix Non-boot cpus cannot be bring up 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1419230320-37558-1-git-send-email-dongsheng.wang@freescale.com \
    --to=dongsheng.wang@freescale.com \
    --cc=anton@samba.org \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=scottwood@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox