From patchwork Wed Mar 25 15:22:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Pieralisi X-Patchwork-Id: 6093291 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 B0077BF90F for ; Wed, 25 Mar 2015 15:24:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B0F6F2035B for ; Wed, 25 Mar 2015 15:24:49 +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 C39A7200D9 for ; Wed, 25 Mar 2015 15:24:48 +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 1Yan8b-0005WY-UQ; Wed, 25 Mar 2015 15:22:33 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yan8V-0005Pk-Hv for linux-arm-kernel@lists.infradead.org; Wed, 25 Mar 2015 15:22:28 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5C8112A; Wed, 25 Mar 2015 08:22:09 -0700 (PDT) Received: from red-moon (red-moon.cambridge.arm.com [10.1.203.137]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 651AC3F51A; Wed, 25 Mar 2015 08:22:03 -0700 (PDT) Date: Wed, 25 Mar 2015 15:22:13 +0000 From: Lorenzo Pieralisi To: Hanjun Guo , will.deacon@arm.com Subject: Re: [PATCH 5/5] ARM64: kernel: acpi: honour acpi=force command line parameter Message-ID: <20150325152213.GB21478@red-moon> References: <1427219940-27201-1-git-send-email-lorenzo.pieralisi@arm.com> <1427219940-27201-6-git-send-email-lorenzo.pieralisi@arm.com> <5512BE9F.8070305@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5512BE9F.8070305@huawei.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150325_082227_743333_3B00CDE0 X-CRM114-Status: GOOD ( 20.63 ) X-Spam-Score: -5.0 (-----) Cc: Ard Biesheuvel , Catalin Marinas , "linux-kernel@vger.kernel.org" , "linux-acpi@vger.kernel.org" , "hanjun.guo@linaro.org" , "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: , 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 Hi Will, On Wed, Mar 25, 2015 at 01:56:47PM +0000, Hanjun Guo wrote: > On 2015/3/25 1:58, Lorenzo Pieralisi wrote: > > If acpi=force is passed on the command line, it forces ACPI to be > > the only available boot method, hence it must be left enabled even > > if the initialization and sanity checks on ACPI tables fails. > > > > This patch refactors ACPI initialization to prevent disabling ACPI > > if acpi=force is passed on the command line. > > > > Signed-off-by: Lorenzo Pieralisi > > Cc: Ard Biesheuvel > > Cc: Hanjun Guo > > Cc: Catalin Marinas > > --- As mentioned, here is the update version for this patch: -- >8 -- Subject: [PATCH] ARM64: kernel: acpi: honour acpi=force command line parameter If acpi=force is passed on the command line, it forces ACPI to be the only available boot method, hence it must be left enabled even if the initialization and sanity checks on ACPI tables fails. This patch refactors ACPI initialization to prevent disabling ACPI if acpi=force is passed on the command line. Signed-off-by: Lorenzo Pieralisi Acked-by: Ard Biesheuvel Acked-by: Hanjun Guo Cc: Ard Biesheuvel Cc: Hanjun Guo Cc: Catalin Marinas --- arch/arm64/include/asm/acpi.h | 3 --- arch/arm64/kernel/acpi.c | 16 ++++++++++++---- arch/arm64/kernel/setup.c | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h index e1a8965..59c05d8 100644 --- a/arch/arm64/include/asm/acpi.h +++ b/arch/arm64/include/asm/acpi.h @@ -38,7 +38,6 @@ 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) @@ -92,8 +91,6 @@ 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 172b7c9..cd60329 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; -bool param_acpi_force __initdata; +static bool param_acpi_force __initdata; static int __init parse_acpi(char *arg) { @@ -284,8 +284,13 @@ out: * We can parse ACPI boot-time tables such as MADT after * this function is called. * - * ACPI is enabled on return if ACPI tables initialized and sanity checks - * passed, disabled otherwise + * On return ACPI is enabled if either: + * + * - ACPI tables are initialized and sanity checks passed + * - acpi=force was passed in the command line and ACPI was not disabled + * explicitly through acpi=off command line parameter + * + * ACPI is disabled on function return otherwise */ void __init acpi_boot_table_init(void) { @@ -309,10 +314,13 @@ void __init acpi_boot_table_init(void) * If ACPI tables are initialized and FADT sanity checks passed, * leave ACPI enabled and carry on booting; otherwise disable ACPI * on initialization error. + * If acpi=force was passed on the command line it forces ACPI + * to be enabled even if its initialization failed. */ if (acpi_table_init() || acpi_fadt_sanity_check()) { pr_err("Failed to init ACPI tables\n"); - disable_acpi(); + if (!param_acpi_force) + disable_acpi(); } } diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index d60b1ad..b278311 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 && !param_acpi_force) { + if (acpi_disabled) { unflatten_device_tree(); psci_dt_init(); cpu_read_bootcpu_ops();