From patchwork Tue Mar 24 14:02:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 6080071 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9DE99BF90F for ; Tue, 24 Mar 2015 14:26:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 26BE12024D for ; Tue, 24 Mar 2015 14:26:31 +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 4190F201D3 for ; Tue, 24 Mar 2015 14:26:30 +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 1YaPi4-0003Ct-Lj; Tue, 24 Mar 2015 14:21:36 +0000 Received: from mail-pd0-f169.google.com ([209.85.192.169]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YaPTP-00052G-73 for linux-arm-kernel@lists.infradead.org; Tue, 24 Mar 2015 14:06:28 +0000 Received: by pdbop1 with SMTP id op1so222348883pdb.2 for ; Tue, 24 Mar 2015 07:06:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=H7MD4XvNfH/pHzsS9TAU4ePknebDuhSh9PYfRVaFkzs=; b=Bf9gObopnZhwZi3ZS7dtkFv7/X6eu1vAiZUPeOOan0MB8XjoQNIahJvgP5tU//kzN5 h5eZMpKhpwQNgVsml5nyc5EtmQBCLwLIN70W2zbK6W/Kwf8XPRTIc5cDqakXnsj8zqW5 HvaNb5PltlI6vw9/B9Rq9huURoC96cxeQHNJFU5trwvXXNaK6ZeYPuGSQMsIzmqRAFj8 dO1QHXY7rDY1dL6z6dhbdVBNup5u7ZwTci3jSMF/IWcQk/XW4N6nQgVimHz8ZD5dMDEp H+ZfXLvMzKA5OFDQmuT4KT7wmaqc0ge+dH9Ayj4bbXNNF/gtKdZAaHVCeYtKtk/3dRHj pK6w== X-Gm-Message-State: ALoCoQmis3Zpn7GmvTxhymFtmUtB4MCEDfdmqE6UVNxNdpgeYMQ0WrSoBd9IT48mE1sgJtuu/OGj X-Received: by 10.70.31.66 with SMTP id y2mr8154978pdh.118.1427205964493; Tue, 24 Mar 2015 07:06:04 -0700 (PDT) Received: from localhost ([180.150.148.224]) by mx.google.com with ESMTPSA id tr8sm4399653pab.4.2015.03.24.07.06.02 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 24 Mar 2015 07:06:03 -0700 (PDT) From: Hanjun Guo To: Catalin Marinas , "Rafael J. Wysocki" , Will Deacon , Olof Johansson , Grant Likely Subject: [patch v11 23/23] ARM64 / ACPI: Don't unflatten device tree if acpi=force is passed Date: Tue, 24 Mar 2015 22:02:56 +0800 Message-Id: <1427205776-5060-24-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427205776-5060-1-git-send-email-hanjun.guo@linaro.org> References: <1427205776-5060-1-git-send-email-hanjun.guo@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150324_070627_358072_A59527E2 X-CRM114-Status: GOOD ( 12.60 ) X-Spam-Score: -0.7 (/) Cc: Mark Rutland , Ashwin Chaugule , Lorenzo Pieralisi , Robert Richter , Arnd Bergmann , Graeme Gregory , linaro-acpi@lists.linaro.org, Marc Zyngier , Jon Masters , Timur Tabi , Mark Salter , linux-kernel@vger.kernel.org, Ard Biesheuvel , linux-acpi@vger.kernel.org, Mark Brown , Hanjun Guo , Suravee Suthikulpanit , Sudeep Holla , linux-arm-kernel@lists.infradead.org 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since the policy is that once we pass acpi=force in the early param, we will not unflatten device tree even if ACPI is disabled in ACPI table init fails, so fix the code by comparinging both acpi_disabled and param_acpi_force before the device tree is unflattened. CC: Ard Biesheuvel Signed-off-by: Hanjun Guo Acked-by: Catalin Marinas --- arch/arm64/include/asm/acpi.h | 3 +++ arch/arm64/kernel/acpi.c | 2 +- arch/arm64/kernel/setup.c | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h index 59c05d8..e1a8965 100644 --- a/arch/arm64/include/asm/acpi.h +++ b/arch/arm64/include/asm/acpi.h @@ -38,6 +38,7 @@ typedef u64 phys_cpuid_t; extern int acpi_disabled; extern int acpi_noirq; extern int acpi_pci_disabled; +extern bool param_acpi_force; /* 1 to indicate PSCI 0.2+ is implemented */ static inline bool acpi_psci_present(void) @@ -91,6 +92,8 @@ void __init acpi_init_cpus(void); static inline bool acpi_psci_present(void) { return false; } static inline bool acpi_psci_use_hvc(void) { return false; } static inline void acpi_init_cpus(void) { } + +#define param_acpi_force false #endif /* CONFIG_ACPI */ #endif /*_ASM_ACPI_H*/ diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c index 5819ef7..fe9d8f0 100644 --- a/arch/arm64/kernel/acpi.c +++ b/arch/arm64/kernel/acpi.c @@ -43,7 +43,7 @@ static int enabled_cpus; static bool bootcpu_valid __initdata; static bool param_acpi_off __initdata; -static bool param_acpi_force __initdata; +bool param_acpi_force __initdata; static int __init parse_acpi(char *arg) { diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index b278311..d60b1ad 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -390,7 +390,7 @@ void __init setup_arch(char **cmdline_p) early_ioremap_reset(); - if (acpi_disabled) { + if (acpi_disabled && !param_acpi_force) { unflatten_device_tree(); psci_dt_init(); cpu_read_bootcpu_ops();