All of lore.kernel.org
 help / color / mirror / Atom feed
From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: acpi: add a Kconfig option to prefer ACPI boot over DT
Date: Mon, 11 Apr 2016 13:19:28 +0200	[thread overview]
Message-ID: <1460373568-4374-1-git-send-email-ard.biesheuvel@linaro.org> (raw)

If both ACPI and DT platform descriptions are available, and the
kernel was configured at build time to support both flavours, the
default policy in absence of a acpi=[off|force] kernel command line
parameter is to prefer DT over ACPI.

This adds an option to invert that default policy, and prefer ACPI
over DT instead. Note that this policy is still superseded by the
value of the acpi= command line parameter.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 arch/arm64/Kconfig       | 13 +++++++++++++
 arch/arm64/kernel/acpi.c |  3 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 4f436220384f..f3aef40ad0ac 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -918,6 +918,19 @@ config DMI
 	  However, even with this option, the resultant kernel should
 	  continue to boot on existing non-UEFI platforms.
 
+config PREFER_ACPI_OVER_DT
+	bool "Prefer booting via ACPI if both ACPI and DT are available"
+	depends on ACPI
+	help
+	  If both ACPI and DT platform descriptions are available, and the
+	  kernel was configured at build time to support both flavours, the
+	  default policy in absence of a acpi=[off|force] kernel command line
+	  parameter is to prefer DT over ACPI.
+
+	  This option inverts that default policy, by preferring ACPI over DT
+	  instead. Note that this default policy is still superseded by the
+	  value of the acpi= command line parameter.
+
 endmenu
 
 menu "Userspace binary formats"
diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
index d1ce8e2f98b9..50ac056fb1fd 100644
--- a/arch/arm64/kernel/acpi.c
+++ b/arch/arm64/kernel/acpi.c
@@ -188,7 +188,8 @@ void __init acpi_boot_table_init(void)
 	 *   and ACPI has not been force enabled (acpi=force)
 	 */
 	if (param_acpi_off ||
-	    (!param_acpi_force && of_scan_flat_dt(dt_scan_depth1_nodes, NULL)))
+	    (!IS_ENABLED(CONFIG_PREFER_ACPI_OVER_DT) &&
+	     !param_acpi_force && of_scan_flat_dt(dt_scan_depth1_nodes, NULL)))
 		return;
 
 	/*
-- 
2.5.0

             reply	other threads:[~2016-04-11 11:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-11 11:19 Ard Biesheuvel [this message]
2016-04-11 12:01 ` [PATCH] arm64: acpi: add a Kconfig option to prefer ACPI boot over DT Graeme Gregory
2016-04-11 23:53   ` Roy Franz
2016-04-12 13:07 ` Catalin Marinas
2016-04-12 13:19   ` Ard Biesheuvel
2016-04-12 13:35     ` Catalin Marinas
2016-04-12 19:41       ` Roy Franz (HPE)
2016-04-13 13:59         ` Catalin Marinas
2016-04-13 17:21           ` Roy Franz
2016-04-14 16:46             ` Catalin Marinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1460373568-4374-1-git-send-email-ard.biesheuvel@linaro.org \
    --to=ard.biesheuvel@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.