Skip to content

Commit

Permalink
ARM: 7064/1: vexpress: Use wfi macro in platform_do_lowpower.
Browse files Browse the repository at this point in the history
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>
Reviewed-by: Jamie Iles <jamie@jamieiles.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Nick Bowler authored and Russell King committed Oct 17, 2011
1 parent ef4c536 commit b3377d1
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions arch/arm/mach-vexpress/hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <linux/smp.h>

#include <asm/cacheflush.h>
#include <asm/system.h>

extern volatile int pen_release;

Expand Down Expand Up @@ -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) {
/*
Expand Down

0 comments on commit b3377d1

Please sign in to comment.