From patchwork Mon Jun 1 20:22:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 6524621 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 770529F40A for ; Mon, 1 Jun 2015 20:24:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9000020465 for ; Mon, 1 Jun 2015 20:24:53 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B70E220426 for ; Mon, 1 Jun 2015 20:24:51 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YzWE9-00085B-Jm; Mon, 01 Jun 2015 20:22:29 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YzWE3-0007vH-Vo for linux-arm-kernel@lists.infradead.org; Mon, 01 Jun 2015 20:22:25 +0000 Received: from smtp.codeaurora.org (localhost [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id E376A13FD43; Mon, 1 Jun 2015 20:22:02 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 486) id B6C6013FDB3; Mon, 1 Jun 2015 20:22:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, SUSPICIOUS_RECIPS,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from sboyd-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: sboyd@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 5D05513FD43; Mon, 1 Jun 2015 20:22:01 +0000 (UTC) From: Stephen Boyd To: Russell King Subject: [PATCH] ARM: Enter CPU in ARM state for cpu_resume Date: Mon, 1 Jun 2015 13:22:00 -0700 Message-Id: <1433190120-27798-1-git-send-email-sboyd@codeaurora.org> X-Mailer: git-send-email 2.3.0.rc1.33.g42e4583 X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150601_132224_113355_3B27C305 X-CRM114-Status: GOOD ( 14.33 ) X-Spam-Score: 2.5 (++) Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Lina Iyer X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The standard boot protocol on ARM requires CPUs to be entered in the ARM state, unless they don't support the ARM instruction set (see Documentation/arm/Booting). On THUMB2 kernels, we assume the firmware can determine what state to enter the kernel in, but some firmwares don't honor the thumb bit. Make the cpu_resume symbol an ARM symbol, so that firmwares that honor the thumb bit will enter the kernel in ARM state and firmwares that don't honor the thumb bit will be able to enter the kernel in ARM state without more changes. This fixes a problem reported by Kevin Hilman where the ifc6410 fails to boot for THUMB2 kernels because the platform's firmware always enters the kernel in ARM mode from deep idle states. Reported-by: Kevin Hilman Suggested-by: Ard Biesheuvel Cc: Lina Iyer Signed-off-by: Stephen Boyd --- arch/arm/kernel/sleep.S | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm/kernel/sleep.S b/arch/arm/kernel/sleep.S index 76bb3128e135..7c289ebb0b45 100644 --- a/arch/arm/kernel/sleep.S +++ b/arch/arm/kernel/sleep.S @@ -118,7 +118,12 @@ ENDPROC(cpu_resume_after_mmu) .text .align + .arm ENTRY(cpu_resume) + THUMB( badr r9, 1f ) @ Kernel is entered in ARM. + THUMB( bx r9 ) @ If this is a Thumb-2 kernel, + THUMB( .thumb ) @ switch to Thumb now. + THUMB(1: ) ARM_BE8(setend be) @ ensure we are in BE mode #ifdef CONFIG_ARM_VIRT_EXT bl __hyp_stub_install_secondary