linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Zhao Chenhui <chenhui.zhao@freescale.com>
To: <linuxppc-dev@lists.ozlabs.org>, <scottwood@freescale.com>,
	<galak@kernel.crashing.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH v8 2/7] powerpc/smp: add generic_set_cpu_up() to set cpu_state as CPU_UP_PREPARE
Date: Fri, 20 Jul 2012 20:42:34 +0800	[thread overview]
Message-ID: <1342788159-27529-3-git-send-email-chenhui.zhao@freescale.com> (raw)
In-Reply-To: <1342788159-27529-1-git-send-email-chenhui.zhao@freescale.com>

In the case of cpu hotplug, the cpu_state should be set to CPU_UP_PREPARE when kicking cpu.
Otherwise, the cpu_state is always CPU_DEAD after calling generic_set_cpu_dead(), which
makes the delay in generic_cpu_die() not happen.

Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
---
 arch/powerpc/include/asm/smp.h |    1 +
 arch/powerpc/kernel/smp.c      |   12 +++++++++++-
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h
index ebc24dc..ce8e2bd 100644
--- a/arch/powerpc/include/asm/smp.h
+++ b/arch/powerpc/include/asm/smp.h
@@ -65,6 +65,7 @@ int generic_cpu_disable(void);
 void generic_cpu_die(unsigned int cpu);
 void generic_mach_cpu_die(void);
 void generic_set_cpu_dead(unsigned int cpu);
+void generic_set_cpu_up(unsigned int cpu);
 int generic_check_cpu_restart(unsigned int cpu);
 #endif
 
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 0321007..fecb038 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -102,7 +102,7 @@ int __devinit smp_generic_kick_cpu(int nr)
 	 * Ok it's not there, so it might be soft-unplugged, let's
 	 * try to bring it back
 	 */
-	per_cpu(cpu_state, nr) = CPU_UP_PREPARE;
+	generic_set_cpu_up(nr);
 	smp_wmb();
 	smp_send_reschedule(nr);
 #endif /* CONFIG_HOTPLUG_CPU */
@@ -406,6 +406,16 @@ void generic_set_cpu_dead(unsigned int cpu)
 	per_cpu(cpu_state, cpu) = CPU_DEAD;
 }
 
+/*
+ * The cpu_state should be set to CPU_UP_PREPARE in kick_cpu(), otherwise
+ * the cpu_state is always CPU_DEAD after calling generic_set_cpu_dead(),
+ * which makes the delay in generic_cpu_die() not happen.
+ */
+void generic_set_cpu_up(unsigned int cpu)
+{
+	per_cpu(cpu_state, cpu) = CPU_UP_PREPARE;
+}
+
 int generic_check_cpu_restart(unsigned int cpu)
 {
 	return per_cpu(cpu_state, cpu) == CPU_UP_PREPARE;
-- 
1.6.4.1

  parent reply	other threads:[~2012-07-20 12:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-20 12:42 [PATCH v8 0/7] power management patch set Zhao Chenhui
2012-07-20 12:42 ` [PATCH v8 1/7] powerpc/smp: use a struct epapr_spin_table to replace macros Zhao Chenhui
2012-07-31 14:24   ` Kumar Gala
2012-07-20 12:42 ` Zhao Chenhui [this message]
2012-07-31 14:24   ` [PATCH v8 2/7] powerpc/smp: add generic_set_cpu_up() to set cpu_state as CPU_UP_PREPARE Kumar Gala
2012-07-20 12:42 ` [PATCH v8 3/7] powerpc/85xx: implement hardware timebase sync Zhao Chenhui
2012-07-31 14:24   ` Kumar Gala
2012-07-20 12:42 ` [PATCH v8 4/7] powerpc/85xx: add HOTPLUG_CPU support Zhao Chenhui
2012-07-31 14:24   ` Kumar Gala
2012-07-20 12:42 ` [PATCH v8 5/7] powerpc/85xx: add sleep and deep sleep support Zhao Chenhui
2012-07-31 14:15   ` Kumar Gala
2012-08-02 11:12     ` Zhao Chenhui
2012-07-20 12:42 ` [PATCH v8 6/7] fsl_pmc: Add API to enable device as wakeup event source Zhao Chenhui
2012-07-20 12:42 ` [PATCH v8 7/7] powerpc/85xx: add support to JOG feature using cpufreq interface Zhao Chenhui
2012-07-31 14:21   ` Kumar Gala
2012-07-26 14:02 ` [PATCH v8 0/7] power management patch set Li Yang
2012-07-26 17:29   ` Kumar Gala
2012-07-27  3:14     ` Li Yang
2012-07-27 21:28       ` Kumar Gala
2012-07-27  1:43   ` Scott Wood

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=1342788159-27529-3-git-send-email-chenhui.zhao@freescale.com \
    --to=chenhui.zhao@freescale.com \
    --cc=galak@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).