Re: [PATCH v2 12/26] PCI: of: Set fwnode device of newly created PCI device nodes

Andy Shevchenko
2025-05-08T18:31:45Z

On Wed, May 07, 2025 at 09:12:54AM +0200, Herve Codina wrote:
> Device-tree node can be created when CONFIG_PCI_DYNAMIC_OF_NODES. Those
> node are created and filled based on PCI core information but the
> fwnode device field is not set.
>
> When later an overlay is applied, this consuses fw_devlink. Indeed,

consuses?

> without any device attached to the node, fw_devlink considers that this
> node will never become a device. When this node is pointed as a
> supplier, devlink looks at its ancestors in order to find a node with a
> device that could be used as the supplier.
>
> In the PCI use case, this leads to links that wrongly use the PCI root
> bridge device as the supplier instead of the expected PCI device.
>
> Setting the fwnode device to the device of the PCI device allows devlink
> to use this device as a supplier and so, correct links are created.

--
With Best Regards,
Andy Shevchenko