Re: [PATCH v6 13/27] PCI: of: Remove fwnode_dev_initialized() call for a PCI root bridge node
From: Herve Codina
Date: Wed May 06 2026 - 16:30:51 EST
Hi Bjorn,
On Wed, 25 Mar 2026 15:20:37 -0500
Bjorn Helgaas <helgaas@xxxxxxxxxx> wrote:
> On Wed, Mar 25, 2026 at 03:35:40PM +0100, Herve Codina wrote:
> > During the instantiation of devices described by a device-tree overlay
> > applied on a PCI device, devlink displays the following kind of debug
> > messages instead of creating the expected links:
> > 'Not linking xxxx - might never become dev'
> >
> > Without those expected links, the device removal order cannot be
> > correct.
> >
> > Those debug traces are printed by fw_devlink_create_devlink(). In our
> > use case, they are all printed because the supplier of the link has at
> > least one of its ancestor with its fwnode flag FWNODE_FLAG_INITIALIZED
> > set.
> >
> > The culprit ancestor is the PCI root bridge.
> >
> > The fwnode related to the PCI root bridge is created dynamically by the
> > of_pci_make_host_bridge_node() function. During this creation
> > fwnode_dev_initialized() is called which set the FWNODE_FLAG_INITIALIZED
> > flag.
> >
> > Calling fwnode_dev_initialized() tells devlink that the device related
> > to this node is handled out of the driver core. This is not correct in
> > our case. Indeed the device related to this firmware node is handled
> > using driver core mechanisms and is fully compliant devlink
> > expectations.
> >
> > Simply remove the fwnode_dev_initialized() call. With that done, the
> > devlink debug messages are no more displayed and links that were missing
> > are correctly created.
> >
> > Signed-off-by: Herve Codina <herve.codina@xxxxxxxxxxx>
>
> I would ordinarily make sure the person who added
> fwnode_dev_initialized() here was ok with its removal, but it looks
> like you added this with 1f340724419e ("PCI: of: Create device tree
> PCI host bridge node"), so I assume you're ok with removing it :)
Yes, I am really ok to remove it :)
>
> I suppose there could be a "Fixes: 1f340724419e" tag, but maybe
> there's no need to backport this anywhere?
Yes, I will add the Fixes tag.
Also the previous patch ("PCI: of: Set fwnode device of newly created PCI
device nodes") fixes 407d1a51921e ("PCI: Create device tree node for bridge")
I plan to add "Fixes: 407d1a51921e" to the previous patch to make things
consistent.
To ease backports and avoid conflicts, I plan to add 'Cc: stable' in 4
patches:
- patch 13 "PCI: of: Remove fwnode_dev_initialized() call for a PCI root
bridge node"
This current patch with Fixes added
- patch 12 "PCI: of: Set fwnode device of newly created PCI device nodes"
The previous patch with Fixes added
- patch 11 "PCI: of: Use fw_devlink_set_device()"
Avoid conflict when patch 13 is applied
- patch 6 "driver core: fw_devlink: Introduce fw_devlink_set_device()"
Needed for patch 11 and 12
Do you think it makes sense ?
Best regards,
Hervé
>
> Acked-by: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
>
> > ---
> > drivers/pci/of.c | 1 -
> > 1 file changed, 1 deletion(-)
> >
> > diff --git a/drivers/pci/of.c b/drivers/pci/of.c
> > index b694fcda16b1..0993257fe025 100644
> > --- a/drivers/pci/of.c
> > +++ b/drivers/pci/of.c
> > @@ -811,7 +811,6 @@ void of_pci_make_host_bridge_node(struct pci_host_bridge *bridge)
> > */
> > of_node_set_flag(np, OF_POPULATED);
> > fw_devlink_set_device(&np->fwnode, &bridge->dev);
> > - fwnode_dev_initialized(&np->fwnode, true);
> >
> > ret = of_changeset_apply(cset);
> > if (ret)
> > --
> > 2.53.0
> >
--
Hervé Codina, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com