From patchwork Mon Aug 22 13:54:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Bowler X-Patchwork-Id: 1085382 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7MDtUEO011428 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 22 Aug 2011 13:55:51 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QvUyG-0002YR-4o; Mon, 22 Aug 2011 13:55:20 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QvUyF-0007Yf-Nu; Mon, 22 Aug 2011 13:55:19 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QvUyD-0007Ya-Op for linux-arm-kernel@canuck.infradead.org; Mon, 22 Aug 2011 13:55:17 +0000 Received: from dsl-67-204-24-19.acanac.net ([67.204.24.19] helo=mail.ellipticsemi.com) by casper.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QvUyA-0003MR-Ld for linux-arm-kernel@lists.infradead.org; Mon, 22 Aug 2011 13:55:16 +0000 Received: from nbowler by mail.ellipticsemi.com with local (Exim 4.76) (envelope-from ) id 1QvUxd-0008GC-L4; Mon, 22 Aug 2011 09:54:41 -0400 From: Nick Bowler To: Catalin Marinas Subject: [PATCH v2] ARM: vexpress: Use wfi macro in platform_do_lowpower. Date: Mon, 22 Aug 2011 09:54:19 -0400 Message-Id: <1314021259-31710-1-git-send-email-nbowler@elliptictech.com> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: References: X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110822_145515_020001_6E1A17DF X-CRM114-Status: GOOD ( 12.55 ) X-Spam-Score: 2.7 (++) X-Spam-Report: SpamAssassin version 3.3.2 on casper.infradead.org summary: Content analysis details: (2.7 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RCVD_IN_RP_RNBL RBL: Relay in RNBL, https://senderscore.org/blacklistlookup/ [67.204.24.19 listed in bl.score.senderscore.com] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 1.0 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.7 KHOP_DYNAMIC Relay looks like a dynamic address 1.6 FROM_12LTRDOM From a 12-letter domain Cc: Jamie Iles , Russell King , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Mon, 22 Aug 2011 13:55:51 +0000 (UTC) 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 Reviewed-by: Jamie Iles --- 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 #include +#include 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) { /*