public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Herve Codina <herve.codina@bootlin.com>
To: Andrea della Porta <andrea.porta@suse.com>
Cc: Bjorn Helgaas <helgaas@kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	mbrugger@suse.com, guillaume.gardet@arm.com, tiwai@suse.com,
	Lizhi Hou <lizhi.hou@amd.com>, Rob Herring <robh@kernel.org>
Subject: Re: [PATCH v2] PCI: of: Downgrade error message on missing of_root node
Date: Thu, 6 Nov 2025 18:27:08 +0100	[thread overview]
Message-ID: <20251106182708.03cfb6c6@bootlin.com> (raw)
In-Reply-To: <aQy9C8315Gu5F5No@apocalypse>

Hi Andrea,

+ CC Rob

On Thu, 6 Nov 2025 16:21:47 +0100
Andrea della Porta <andrea.porta@suse.com> wrote:

> Hi Herve,
> 
> On 13:18 Thu 06 Nov     , Herve Codina wrote:
> > Hi, Andrea, Bjorn,
> > 
> > On Thu, 6 Nov 2025 12:04:07 +0100
> > Andrea della Porta <andrea.porta@suse.com> wrote:
> >   
> > > [+cc Herve]
> > > 
> > > Hi Bjorn,
> > > 
> > > On 18:23 Wed 05 Nov     , Bjorn Helgaas wrote:  
> > > > [+cc Lizhi]
> > > > 
> > > > On Wed, Nov 05, 2025 at 07:33:40PM +0100, Andrea della Porta wrote:    
> > > > > When CONFIG_PCI_DYNAMIC_OF_NODES is enabled, an error message
> > > > > is generated if no 'of_root' node is defined.
> > > > > 
> > > > > On DT-based systems, this cannot happen as a root DT node is
> > > > > always present. On ACPI-based systems, this is not a true error
> > > > > because a DT is not used.
> > > > > 
> > > > > Downgrade the pr_err() to pr_info() and reword the message text
> > > > > to be less context specific.    
> > > > 
> > > > of_pci_make_host_bridge_node() is called in the very generic
> > > > pci_register_host_bridge() path.  Does that mean every boot of a
> > > > kernel with CONFIG_PCI_DYNAMIC_OF_NODES on a non-DT system will see
> > > > this message?    
> > > 
> > > This is the case, indeed. That's why downgrading to info seems sensible.
> > >   
> > > > 
> > > > This message seems like something that will generate user questions.
> > > > Or is this really an error, and we were supposed to have created
> > > > of_root somewhere but it failed?  If so, I would expect a message
> > > > where the of_root creation failed.    
> > > 
> > > Not really an error per se: on ACPI system we usually don't have DT, so
> > > this message just warns you that there will be no pci nodes created on it.
> > > Which, again, should be of no importance on ACPI.  
> > 
> > I my last understanding, all architecture (even x86) have the DT root node
> > set. This node is empty on architectures that don't use DT to describe
> > hardware at boot (ACPI for instance).  
> 
> This does not seem to be the case for all arch, see below.
> 
> > 
> > This DT node is needed for PCI board that will be described by a DT overlay.
> > LAN966x for instance.
> > 
> > On v6.18-rc1 kernel, I successfully used my LAN966x board on a ACPI system.
> > This means that of_root DT node was present on my system.
> >   
> > > 
> > > The only scenario in which this message is actually an error would be on
> > > ACPI system that use DT as a complement to make runtime overlay work,  
> > 
> > It is an error also if you use a PCI board that needs PCI DT nodes
> > (CONFIG_PCI_DYNAMIC_OF_NODES) Lan966x for instance.  
> 
> Yes, I was referring exactly to that.
> 
> >   
> > > i.e. the overlay approach for RP1 on RPi5 with ACPI fw. AFAIK this fw is
> > > more a PoC that something really widespread and currntly the overlay
> > > approach is in stand-by anyway (meaning no one will use it unless some
> > > major changes will be made to make it work). But there may be other
> > > situations in which this scenario could arise, I'm thinking about Bootlin's
> > > LAN966x driver which also uses runtime overlay to describe thw hw.
> > > On ACPI system the root DT node is not created because unflatten_device_tree()
> > > is not called.  
> > 
> > I am not so sure.
> > My LAN966x board is working on a x86 ACPI system.  
> 
> Indeed it depends on the architecture. On x86 an empty DT node is created,
> provided you have CONFIG_OF_EARLY_FLATTREE defined (which I guess you have,
> even if it's not in default config).

Indeed, I have CONFIG_OF_EARLY_FLATTREE = y.

> 
> On arm64, ACPI and DT are mutually exclusive, unless the DT is basically empty
> (i.e. only root node and chosen node). The DT root node is not automatically
> created if not provided at boot, though. This reinforces my idea of providing
> the only root node DT on arm as well, but I'm not entirely sure about 
> possible side effects.
> 

Isn't it possible to have the same kind of operations on ARM64 ACPI and on x86?

In order to have CONFIG_PCI_DYNAMIC_OF_NODES working on ACPI, we need a DT
node, even empty.

ARM64 ACPI without an empty DT node means that no PCI boards using a DT
description will work on this system.

Best regards,
Hervé

  reply	other threads:[~2025-11-06 17:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-05 18:33 [PATCH v2] PCI: of: Downgrade error message on missing of_root node Andrea della Porta
2025-11-06  0:23 ` Bjorn Helgaas
2025-11-06 11:04   ` Andrea della Porta
2025-11-06 12:18     ` Herve Codina
2025-11-06 15:21       ` Andrea della Porta
2025-11-06 17:27         ` Herve Codina [this message]
2025-11-06 17:50           ` Bjorn Helgaas
2025-11-07  9:32             ` Andrea della Porta
2025-11-07 11:58               ` Herve Codina
2025-12-05 13:58                 ` Rob Herring
2026-02-09 18:19                   ` Andrea della Porta
2025-11-07  9:26           ` Andrea della Porta

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=20251106182708.03cfb6c6@bootlin.com \
    --to=herve.codina@bootlin.com \
    --cc=andrea.porta@suse.com \
    --cc=bhelgaas@google.com \
    --cc=guillaume.gardet@arm.com \
    --cc=helgaas@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lizhi.hou@amd.com \
    --cc=mbrugger@suse.com \
    --cc=robh@kernel.org \
    --cc=tiwai@suse.com \
    /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