From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753251AbbCYODs (ORCPT ); Wed, 25 Mar 2015 10:03:48 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:47905 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753187AbbCYODi (ORCPT ); Wed, 25 Mar 2015 10:03:38 -0400 Message-ID: <5512BE9F.8070305@huawei.com> Date: Wed, 25 Mar 2015 21:56:47 +0800 From: Hanjun Guo User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: Lorenzo Pieralisi , , , CC: Catalin Marinas , Will Deacon , Hanjun Guo , Ard Biesheuvel Subject: Re: [PATCH 5/5] ARM64: kernel: acpi: honour acpi=force command line parameter References: <1427219940-27201-1-git-send-email-lorenzo.pieralisi@arm.com> <1427219940-27201-6-git-send-email-lorenzo.pieralisi@arm.com> In-Reply-To: <1427219940-27201-6-git-send-email-lorenzo.pieralisi@arm.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.17.188] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- Although it will introduce some useless table parsing for some bad ACPI tables, it still obey the policy for acpi=force, and it makes param_acpi_force much self-contained, so Acked-by: Hanjun Guo Thanks Hanjun > arch/arm64/include/asm/acpi.h | 3 --- > arch/arm64/kernel/acpi.c | 6 ++++-- > arch/arm64/kernel/setup.c | 2 +- > 3 files changed, 5 insertions(+), 6 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 542f045..789994a 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) > { > @@ -324,8 +324,10 @@ out: > * 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 (err) > + if (err && !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();