Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941561AbcLVXG6 (ORCPT ); Thu, 22 Dec 2016 18:06:58 -0500 Received: from foss.arm.com ([217.140.101.70]:52166 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754283AbcLVXG4 (ORCPT ); Thu, 22 Dec 2016 18:06:56 -0500 Date: Thu, 22 Dec 2016 23:06:51 +0000 From: Mark Rutland To: Jonathan Toppins Cc: linux-arm-kernel@lists.infradead.org, msalter@redhat.com, Catalin Marinas , Will Deacon , Stefano Stabellini , Hanjun Guo , Shannon Zhao , Aleksey Makarov , Ard Biesheuvel , linux-kernel@vger.kernel.org Subject: Re: [RFC] arm64/acpi: make ACPI boot preference configurable Message-ID: <20161222230650.GB30170@remoulade> References: <7eba0601099f75f19021c4259eca75ada06f4511.1482341997.git.jtoppins@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7eba0601099f75f19021c4259eca75ada06f4511.1482341997.git.jtoppins@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2860 Lines: 72 Hi, On Wed, Dec 21, 2016 at 12:54:05PM -0500, Jonathan Toppins wrote: > This patch allows a user to configure ACPI to be preferred over > device-tree. > > Currently for ACPI to be used a user either has to set acpi=on on the > kernel command line or make sure any device tree passed to the kernel > is empty. If the dtb passed to the kernel is non-empty then device-tree > will be chosen as the boot method of choice even if it is not correct. > To prevent this situation where a system is only intended to be booted > via ACPI a user can set this kernel configuration so it ignores > device-tree settings unless ACPI table checks fail. I'm a little confused here. Judging by the comment inside acpi_boot_table_init, and the code immediately below it, in the absence of a "real" DTB, ACPI will be used. Could you elaborate on the situation where "a system is only intended to be booted via ACPI"? e.g. whose preference or requirement is this? The HW vendor, distro, or user? Why/when would the current behaviour not be correct? Thanks, Mark. > > Signed-off-by: Jonathan Toppins > --- > arch/arm64/Kconfig | 13 +++++++++++++ > arch/arm64/kernel/acpi.c | 2 +- > 2 files changed, 14 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > index 111742126897..e432e84245b9 100644 > --- a/arch/arm64/Kconfig > +++ b/arch/arm64/Kconfig > @@ -954,6 +954,19 @@ config ARM64_ACPI_PARKING_PROTOCOL > protocol even if the corresponding data is present in the ACPI > MADT table. > > +config ARM64_PREFER_ACPI > + bool "Prefer usage of ACPI boot tables over device-tree" > + depends on ACPI > + help > + Normally device-tree is preferred over ACPI on arm64 unless > + explicitly preferred via kernel command line, something like: acpi=on > + This configuration changes this default behaviour by pretending > + the user set acpi=on on the command line. This configuration still > + allows the user to turn acpi table parsing off via acpi=off. If > + for some reason the table checks fail the system will still fall > + back to using device-tree unless the user explicitly sets acpi=force > + on the command line. > + > config CMDLINE > string "Default kernel command string" > default "" > diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c > index 252a6d9c1da5..b5dfa5752ff7 100644 > --- a/arch/arm64/kernel/acpi.c > +++ b/arch/arm64/kernel/acpi.c > @@ -43,7 +43,7 @@ int acpi_pci_disabled = 1; /* skip ACPI PCI scan and IRQ initialization */ > EXPORT_SYMBOL(acpi_pci_disabled); > > static bool param_acpi_off __initdata; > -static bool param_acpi_on __initdata; > +static bool param_acpi_on __initdata = IS_ENABLED(CONFIG_ARM64_PREFER_ACPI); > static bool param_acpi_force __initdata; > > static int __init parse_acpi(char *arg) > -- > 2.10.2 >