All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shaohua Li <shaohua.li@intel.com>
To: lkml <linux-kernel@vger.kernel.org>
Cc: "Raj, Ashok" <ashok.raj@intel.com>, akpm <akpm@osdl.org>, ak <ak@muc.de>
Subject: trival patch: disable interrupt in play_dead
Date: Mon, 28 Nov 2005 22:48:16 -0800	[thread overview]
Message-ID: <1133246896.8076.4.camel@linux.site> (raw)


It's physical CPU hotplug now, so disable interrupt in play_dead.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
---

 linux-2.6.14-root/arch/x86_64/kernel/process.c |    5 +++--
 linux-2.6.14-root/include/asm-x86_64/system.h  |    2 ++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff -puN arch/x86_64/kernel/process.c~cpuhp-disable-interrupt arch/x86_64/kernel/process.c
--- linux-2.6.14/arch/x86_64/kernel/process.c~cpuhp-disable-interrupt	2005-11-28 22:20:28.000000000 -0800
+++ linux-2.6.14-root/arch/x86_64/kernel/process.c	2005-11-28 22:20:28.000000000 -0800
@@ -157,7 +157,7 @@ EXPORT_SYMBOL_GPL(cpu_idle_wait);
 DECLARE_PER_CPU(int, cpu_state);
 
 #include <asm/nmi.h>
-/* We don't actually take CPU down, just spin without interrupts. */
+/* We halt the CPU with physical CPU hotplug */
 static inline void play_dead(void)
 {
 	idle_task_exit();
@@ -166,8 +166,9 @@ static inline void play_dead(void)
 	/* Ack it */
 	__get_cpu_var(cpu_state) = CPU_DEAD;
 
+	local_irq_disable();
 	while (1)
-		safe_halt();
+		halt();
 }
 #else
 static inline void play_dead(void)
diff -puN include/asm-x86_64/system.h~cpuhp-disable-interrupt include/asm-x86_64/system.h
--- linux-2.6.14/include/asm-x86_64/system.h~cpuhp-disable-interrupt	2005-11-28 22:20:28.000000000 -0800
+++ linux-2.6.14-root/include/asm-x86_64/system.h	2005-11-28 22:20:28.000000000 -0800
@@ -315,6 +315,8 @@ static inline unsigned long __cmpxchg(vo
 #define local_irq_enable()	__asm__ __volatile__("sti": : :"memory")
 /* used in the idle loop; sti takes one instruction cycle to complete */
 #define safe_halt()		__asm__ __volatile__("sti; hlt": : :"memory")
+/* used when interrupts are already enabled or to shutdown the processor */
+#define halt()			__asm__ __volatile__("hlt": : :"memory")
 
 #define irqs_disabled()			\
 ({					\
_



                 reply	other threads:[~2005-11-28 23:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1133246896.8076.4.camel@linux.site \
    --to=shaohua.li@intel.com \
    --cc=ak@muc.de \
    --cc=akpm@osdl.org \
    --cc=ashok.raj@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 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.