mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Wiehler <stefan.wiehler@nokia.com>
To: Rob Herring <robh+dt@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"x86@kernel.org" <x86@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Keep bootloader DTB when ACPI is enabled
Date: Tue, 21 Jan 2025 09:18:44 +0100	[thread overview]
Message-ID: <6592d024-8d43-4b0c-8036-16df2bac9446@nokia.com> (raw)

Hi all,

We store various metadata (e.g. IDs and serial numbers) in the DT which must be
consistent over multiple product generations; therefore we enable CONFIG_OF
even when ACPI is used for boot. On such ACPI-based (i.e. x86) boards, ACPI is
used for boot while the DT holds only product-specific nodes not of any
interest to the core kernel. While this is currently not an issue on our 6.1
kernel, I noticed that commit 7b937cc243e5 ("of: Create of_root if no dtb
provided by firmware") drops the bootloader provided DTB if ACPI is not
disabled [1]. When one removes this check, several warnings are emitted because
register_lapic_address() and topology_register_boot_apic() are called from both
ACPI and DT initialization [2] [3].

As we need to maintain above use case for the foreseeable future, we would like
to introduce an alternate mode that keeps the bootloader provided DTB even if
ACPI is enabled, via e.g. a new command line parameter "acpi_keep_dtb".
Regarding above warnings, ACPI initialization should take precedence and we
would simply skip the following initialization from DT code if the
"acpi_keep_dtb" command line parameter is present.

Please provide feedback if you would accept such a solution before I start to
implement something.

Kind regards,

Stefan

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/of/fdt.c?id=ffd294d346d185b70e28b1a28abe367bbfe53c04#n1219
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/x86/kernel/apic/apic.c?id=ffd294d346d185b70e28b1a28abe367bbfe53c04#n2083
[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/x86/kernel/cpu/topology.c?id=ffd294d346d185b70e28b1a28abe367bbfe53c04#n305

             reply	other threads:[~2025-01-21  8:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-21  8:18 Stefan Wiehler [this message]
2025-01-24 15:03 ` Rob Herring
2025-01-24 15:17   ` Stefan Wiehler

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=6592d024-8d43-4b0c-8036-16df2bac9446@nokia.com \
    --to=stefan.wiehler@nokia.com \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®