linux-pci.vger.kernel.org archive mirror
 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: Fri, 7 Nov 2025 12:58:28 +0100	[thread overview]
Message-ID: <20251107125828.18a034de@bootlin.com> (raw)
In-Reply-To: <aQ28s57R0YfrqwdG@apocalypse>

Hi Andrea, Bjorn,

On Fri, 7 Nov 2025 10:32:35 +0100
Andrea della Porta <andrea.porta@suse.com> wrote:

> Hi Bjorn,
> 
> On 11:50 Thu 06 Nov     , Bjorn Helgaas wrote:
> > On Thu, Nov 06, 2025 at 06:27:08PM +0100, Herve Codina wrote:  
> > > On Thu, 6 Nov 2025 16:21:47 +0100
> > > Andrea della Porta <andrea.porta@suse.com> wrote:  
> > > > On 13:18 Thu 06 Nov     , Herve Codina wrote:  
> > > > > On Thu, 6 Nov 2025 12:04:07 +0100
> > > > > Andrea della Porta <andrea.porta@suse.com> wrote:  
> > > > > > On 18:23 Wed 05 Nov     , Bjorn Helgaas wrote:    
> > > > > > > On Wed, Nov 05, 2025 at 07:33:40PM +0100, Andrea della Porta wrote:      
> > Patch at https://lore.kernel.org/r/955bc7a9b78678fad4b705c428e8b45aeb0cbf3c.1762367117.git.andrea.porta@suse.com,
> > added back for reference:
> > 
> >   diff --git a/drivers/pci/of.c b/drivers/pci/of.c
> >   index 3579265f1198..872c36b195e3 100644
> >   --- a/drivers/pci/of.c
> >   +++ b/drivers/pci/of.c
> >   @@ -775,7 +775,7 @@ void of_pci_make_host_bridge_node(struct pci_host_bridge *bridge)
> > 
> > 	  /* Check if there is a DT root node to attach the created node */
> > 	  if (!of_root) {
> >   -               pr_err("of_root node is NULL, cannot create PCI host bridge node\n");
> >   +               pr_info("Missing DeviceTree, cannot create PCI host bridge node\n");
> > 		  return;
> > 	  }
> >   
> > > > > > > > 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.      
> > 
> > I think we should just remove the message completely.  I don't want
> > users to enable CONFIG_PCI_DYNAMIC_OF_NODES out of curiosity or
> > willingness to test, and then ask about this message.  
> 
> Agreed. This would be the easy solution, the other being creating the
> empty DT so that the message will never be printed. But this require some
> careful thought. The latter solution will be needed if we'll ever want to
> make drivers like RP1 or lan96xx (which uses the runtime overlay) to work.
> 
> > 
> > "You can avoid the message by also enabling CONFIG_OF_EARLY_FLATTREE"
> > is not a very satisfactory answer.  
> 
> Unfortunately this would work on x86, but not on arm. And who knows on
> other platforms.
> 
> > 
> > A message at the point of *needing* this, i.e., when loading an
> > overlay fails for lack of this dynamic DT, is fine.  
> 
> It seems fine to me.
> 

Ok, even if I would prefer having an empty (or not) of_node available on all
platforms, what is proposed makes sense especially in regards to potential
users questions.

Best regards,
Hervé


  reply	other threads:[~2025-11-07 11:58 UTC|newest]

Thread overview: 10+ 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
2025-11-06 17:50           ` Bjorn Helgaas
2025-11-07  9:32             ` Andrea della Porta
2025-11-07 11:58               ` Herve Codina [this message]
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=20251107125828.18a034de@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;
as well as URLs for NNTP newsgroup(s).