linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: nbowler@elliptictech.com (Nick Bowler)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] ARM: vexpress: Use wfi macro in platform_do_lowpower.
Date: Mon, 22 Aug 2011 09:54:19 -0400	[thread overview]
Message-ID: <1314021259-31710-1-git-send-email-nbowler@elliptictech.com> (raw)
In-Reply-To: <CAHkRjk6Fq+1b_uM+DFACS1QVd7B6_1XhqRw-27i88U1VyvLk+Q@mail.gmail.com>

Current Versatile Express CPU hotplug code includes a hardcoded WFI
instruction, in ARM encoding.  When the kernel is compiled in Thumb-2
mode, this is invalid and causes the machine to hang hard when a CPU
is offlined.

Using the wfi macro (which uses the appropriate assembler mnemonic)
causes the correct instruction to be emitted in either case.  As a
consequence of this change, an apparently vestigial "cc" clobber is
dropped from the asm (the macro uses "memory" only).

Signed-off-by: Nick Bowler <nbowler@elliptictech.com>
---
 arch/arm/mach-vexpress/hotplug.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

OK.  If this version is acceptable, I'll follow up with patches for the
other platforms.

diff --git a/arch/arm/mach-vexpress/hotplug.c b/arch/arm/mach-vexpress/hotplug.c
index ea4cbfb..3668cf9 100644
--- a/arch/arm/mach-vexpress/hotplug.c
+++ b/arch/arm/mach-vexpress/hotplug.c
@@ -13,6 +13,7 @@
 #include <linux/smp.h>
 
 #include <asm/cacheflush.h>
+#include <asm/system.h>
 
 extern volatile int pen_release;
 
@@ -62,13 +63,7 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
 	 * code will have already disabled interrupts
 	 */
 	for (;;) {
-		/*
-		 * here's the WFI
-		 */
-		asm(".word	0xe320f003\n"
-		    :
-		    :
-		    : "memory", "cc");
+		wfi();
 
 		if (pen_release == cpu) {
 			/*
-- 
1.7.3.4

  reply	other threads:[~2011-08-22 13:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-19 18:03 [PATCH RFC] ARM: vexpress: Use assembler mnemonic for WFI in platform_do_lowpower Nick Bowler
2011-08-19 18:15 ` Jamie Iles
2011-08-19 19:26   ` Nick Bowler
2011-08-19 21:14     ` Jamie Iles
2011-08-22  9:43       ` Catalin Marinas
2011-08-22 13:54         ` Nick Bowler [this message]
2011-08-22 13:59           ` [PATCH v2] ARM: vexpress: Use wfi macro " Jamie Iles
2011-08-24 17:51             ` Nick Bowler

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=1314021259-31710-1-git-send-email-nbowler@elliptictech.com \
    --to=nbowler@elliptictech.com \
    --cc=linux-arm-kernel@lists.infradead.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 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).