From patchwork Tue Feb 27 06:05:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Toppins X-Patchwork-Id: 10244353 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 75A9A60362 for ; Tue, 27 Feb 2018 06:06:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 582AA2A4B4 for ; Tue, 27 Feb 2018 06:06:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C8772A4BE; Tue, 27 Feb 2018 06:06:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C5C602A4B4 for ; Tue, 27 Feb 2018 06:06:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=kTosiAk2AeZaf+ir4svJ4kPCaZeChhpBVRfZWxNMOO8=; b=Shl OFR5N1qIyvAxt+daZVvePbJW5btqBCPYn7C0vjJK50Msosy7XK0H40bInEDkKaiajaB4wLvKqlC/I rY4nx+yUMB8AqyFA5Fhwp57Tk4cbvRZDDSGAuRlh66CHAI/FElCGva73taMiFV9yMrKNgfCbkVCgR n+u+UiL8E2G9gRZ357anZBNvu05a4oHWzJ/UkCAi2Kd+Gg/z5uJ7Hce+FbXIl3if5zoDWEa+I6uLX 2nCa2jnXttmidTfLqq/2u/bLv2nP3W8yV68tzUPuO1CBCJV9Fr5haxVdWwPHr81wTPn3X4GhvrziG rwdBlClrjbVLtjrnbCOTnMRAh2UPlzg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eqYOu-00035c-Ld; Tue, 27 Feb 2018 06:06:08 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eqYOt-00035G-6r for linux-arm-kernel@bombadil.infradead.org; Tue, 27 Feb 2018 06:06:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=G43/lBYDRc1iOBQweyiSEnUnMPdRMkPyrXxiXv24qms=; b=R9FTfKZlT7qOjBL2kXdCXIFCF g7ifRPMRJzo4RLiA5IDvv30b++8jvFDZ4xKiig0XOf0kA4Xvfe0+/DlbX9bSlrg22I+BnRdIz52fK yolM8UwJOMP+LsLG1zVzakWF4R00ru0/JbwaZDxmsS+X5fEexFZ5u+jVvHC/0KU8N/lEZO2RDWuAs fQFDJgOdRVf3xn/r1qGkM9KN9g+Z2TSNJpGxaTpLHXBl66RMJhhymhTTkJcJHJIu2yaZayp0DU8ph GxplBV6Ylud9SQD9eM6Ecy+rfZr+z/LJLroIzqogARYMJP418+0c5Axsdk0l58/9937+k9MCXAnmY vStnOvLyA==; Received: from mx3-rdu2.redhat.com ([66.187.233.73] helo=mx1.redhat.com) by merlin.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eqYOq-0004iY-Ae for linux-arm-kernel@lists.infradead.org; Tue, 27 Feb 2018 06:06:05 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 355687D845; Tue, 27 Feb 2018 06:05:36 +0000 (UTC) Received: from jtoppins.rdu.csb (ovpn-120-82.rdu2.redhat.com [10.10.120.82]) by smtp.corp.redhat.com (Postfix) with ESMTP id B0EAE213AEF4; Tue, 27 Feb 2018 06:05:35 +0000 (UTC) From: Jonathan Toppins To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] arm64/acpi: make ACPI boot preference configurable Date: Tue, 27 Feb 2018 01:05:32 -0500 Message-Id: <85047448dc1d2d3c725b6b78d5ef2a89fc81b83b.1519659254.git.jtoppins@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 27 Feb 2018 06:05:36 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 27 Feb 2018 06:05:36 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jtoppins@redhat.com' RCPT:'' X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180227_010604_407011_14E7E039 X-CRM114-Status: GOOD ( 19.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: prarit@redhat.com, rhkernel-list@redhat.com, jcm@redhat.com, bhsharma@redhat.com, rafael.j.wysocki@intel.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, astone@redhat.com, james.morse@arm.com, catalin.marinas@arm.com, andriy.shevchenko@linux.intel.com, mingo@kernel.org, jtoppins@redhat.com 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 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. 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 7381eeb7ef8e..da8d9ab62825 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1170,6 +1170,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 7b09487ff8fb..315b001c45f1 100644 --- a/arch/arm64/kernel/acpi.c +++ b/arch/arm64/kernel/acpi.c @@ -44,7 +44,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)