* [PATCH v7 0/8] lan966x pci device: Add support for SFPs, PCI part
@ 2026-05-11 15:59 Herve Codina
2026-05-11 15:59 ` [PATCH v7 1/8] driver core: fw_devlink: Introduce fw_devlink_set_device() Herve Codina
` (7 more replies)
0 siblings, 8 replies; 11+ messages in thread
From: Herve Codina @ 2026-05-11 15:59 UTC (permalink / raw)
To: Andrew Lunn, Rob Herring, Saravana Kannan, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Bjorn Helgaas,
Charles Keepax, Richard Fitzgerald, David Rhodes, Linus Walleij,
Len Brown, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
Sakari Ailus, Davidlohr Bueso, Jonathan Cameron, Dave Jiang,
Alison Schofield, Vishal Verma, Ira Weiny, Dan Williams,
Lizhi Hou, Herve Codina
Cc: driver-core, linux-kernel, linux-pci, linux-sound, patches,
linux-gpio, linux-acpi, linux-cxl, Allan Nielsen, Horatiu Vultur,
Daniel Machon, Steen Hegelund, Luca Ceresoli, Thomas Petazzoni
Hi,
Previously, I sent a big picture series adding support for SFP ports
available on the LAN966x PCI device [0].
In this series patches touch several parts and sub-system in the kernel.
Reviews have be done and it makes sense to split the series and send
parts separately.
This current series is the extraction of patches related to issues in
the PCI subsystem. It has to be seen as a continuation of the big
picture series but related to this specific core part.
Patches 1 to 6 introduce and use fw_devlink_set_device() in already
existing code. No functional change but the introduction of the
fw_devlink_set_device() wrapper.
Patches 7 and 8 fix fw_devlink issues specific to PCI and the
device-tree nodes created during enumeration.
[0] https://lore.kernel.org/all/20260325143555.451852-1-herve.codina@bootlin.com/
Best regards,
Hervé
Changes:
v6 -> v7
Rebase on top v7.1-rc1
- Patch 1
Add Cc stable. Needed for patches 11 and 12
- Patches 2 to 5
No changes
- Patch 6
Add Cc stable. Needed for patch 13
Add 'Acked-by: Bjorn Helgaas'
- Patch 7
Fix a typo in commit log
Add Fixes tag + Cc stable
Add 'Acked-by: Bjorn Helgaas'
- Patch 8
Add Fixes tag + Cc stable
Add 'Acked-by: Bjorn Helgaas'
Older iterations:
Patches 6 to 13 in the big picture series
https://lore.kernel.org/all/20260325143555.451852-1-herve.codina@bootlin.com/
Herve Codina (8):
driver core: fw_devlink: Introduce fw_devlink_set_device()
drivers: core: Use fw_devlink_set_device()
pinctrl: cs42l43: Use fw_devlink_set_device()
cxl/test: Use device_set_node()
cxl/test: Use fw_devlink_set_device()
PCI: of: Use fw_devlink_set_device()
PCI: of: Set fwnode device of newly created PCI device nodes
PCI: of: Remove fwnode_dev_initialized() call for a PCI root bridge
node
drivers/base/core.c | 4 ++--
drivers/pci/of.c | 10 ++++++++--
drivers/pinctrl/cirrus/pinctrl-cs42l43.c | 2 +-
include/linux/fwnode.h | 6 ++++++
tools/testing/cxl/test/cxl.c | 4 ++--
5 files changed, 19 insertions(+), 7 deletions(-)
--
2.54.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v7 1/8] driver core: fw_devlink: Introduce fw_devlink_set_device()
2026-05-11 15:59 [PATCH v7 0/8] lan966x pci device: Add support for SFPs, PCI part Herve Codina
@ 2026-05-11 15:59 ` Herve Codina
2026-05-11 15:59 ` [PATCH v7 2/8] drivers: core: Use fw_devlink_set_device() Herve Codina
` (6 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Herve Codina @ 2026-05-11 15:59 UTC (permalink / raw)
To: Andrew Lunn, Rob Herring, Saravana Kannan, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Bjorn Helgaas,
Charles Keepax, Richard Fitzgerald, David Rhodes, Linus Walleij,
Len Brown, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
Sakari Ailus, Davidlohr Bueso, Jonathan Cameron, Dave Jiang,
Alison Schofield, Vishal Verma, Ira Weiny, Dan Williams,
Lizhi Hou, Herve Codina
Cc: driver-core, linux-kernel, linux-pci, linux-sound, patches,
linux-gpio, linux-acpi, linux-cxl, Allan Nielsen, Horatiu Vultur,
Daniel Machon, Steen Hegelund, Luca Ceresoli, Thomas Petazzoni,
stable, Ulf Hansson
Setting fwnode->dev is specific to fw_devlink.
In order to avoid having a direct 'fwnode->dev = dev;' in several
place in the kernel, introduce fw_devlink_set_device() helper to perform
this operation.
Having this helper allows to hide the fwnode devlink related stuff
behind the helper.
Cc: stable@vger.kernel.org
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
Cc stable because used by other patches with Fixes + Cc stable
---
include/linux/fwnode.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h
index 80b38fbf2121..b005bd78a379 100644
--- a/include/linux/fwnode.h
+++ b/include/linux/fwnode.h
@@ -252,4 +252,10 @@ void fwnode_links_purge(struct fwnode_handle *fwnode);
void fw_devlink_purge_absent_suppliers(struct fwnode_handle *fwnode);
bool fw_devlink_is_strict(void);
+static inline void fw_devlink_set_device(struct fwnode_handle *fwnode,
+ struct device *dev)
+{
+ fwnode->dev = dev;
+}
+
#endif
--
2.54.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v7 2/8] drivers: core: Use fw_devlink_set_device()
2026-05-11 15:59 [PATCH v7 0/8] lan966x pci device: Add support for SFPs, PCI part Herve Codina
2026-05-11 15:59 ` [PATCH v7 1/8] driver core: fw_devlink: Introduce fw_devlink_set_device() Herve Codina
@ 2026-05-11 15:59 ` Herve Codina
2026-05-11 15:59 ` [PATCH v7 3/8] pinctrl: cs42l43: " Herve Codina
` (5 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Herve Codina @ 2026-05-11 15:59 UTC (permalink / raw)
To: Andrew Lunn, Rob Herring, Saravana Kannan, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Bjorn Helgaas,
Charles Keepax, Richard Fitzgerald, David Rhodes, Linus Walleij,
Len Brown, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
Sakari Ailus, Davidlohr Bueso, Jonathan Cameron, Dave Jiang,
Alison Schofield, Vishal Verma, Ira Weiny, Dan Williams,
Lizhi Hou, Herve Codina
Cc: driver-core, linux-kernel, linux-pci, linux-sound, patches,
linux-gpio, linux-acpi, linux-cxl, Allan Nielsen, Horatiu Vultur,
Daniel Machon, Steen Hegelund, Luca Ceresoli, Thomas Petazzoni,
Ulf Hansson
The code set directly fwnode->dev field.
Use the dedicated fw_devlink_set_device() helper to perform this
operation.
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
---
drivers/base/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index bd2ddf2aab50..5c9a34aaefe1 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -3684,7 +3684,7 @@ int device_add(struct device *dev)
* device and the driver sync_state callback is called for this device.
*/
if (dev->fwnode && !dev->fwnode->dev) {
- dev->fwnode->dev = dev;
+ fw_devlink_set_device(dev->fwnode, dev);
fw_devlink_link_device(dev);
}
@@ -3859,7 +3859,7 @@ void device_del(struct device *dev)
device_unlock(dev);
if (dev->fwnode && dev->fwnode->dev == dev)
- dev->fwnode->dev = NULL;
+ fw_devlink_set_device(dev->fwnode, NULL);
/* Notify clients of device removal. This call must come
* before dpm_sysfs_remove().
--
2.54.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v7 3/8] pinctrl: cs42l43: Use fw_devlink_set_device()
2026-05-11 15:59 [PATCH v7 0/8] lan966x pci device: Add support for SFPs, PCI part Herve Codina
2026-05-11 15:59 ` [PATCH v7 1/8] driver core: fw_devlink: Introduce fw_devlink_set_device() Herve Codina
2026-05-11 15:59 ` [PATCH v7 2/8] drivers: core: Use fw_devlink_set_device() Herve Codina
@ 2026-05-11 15:59 ` Herve Codina
2026-05-11 15:59 ` [PATCH v7 4/8] cxl/test: Use device_set_node() Herve Codina
` (4 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Herve Codina @ 2026-05-11 15:59 UTC (permalink / raw)
To: Andrew Lunn, Rob Herring, Saravana Kannan, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Bjorn Helgaas,
Charles Keepax, Richard Fitzgerald, David Rhodes, Linus Walleij,
Len Brown, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
Sakari Ailus, Davidlohr Bueso, Jonathan Cameron, Dave Jiang,
Alison Schofield, Vishal Verma, Ira Weiny, Dan Williams,
Lizhi Hou, Herve Codina
Cc: driver-core, linux-kernel, linux-pci, linux-sound, patches,
linux-gpio, linux-acpi, linux-cxl, Allan Nielsen, Horatiu Vultur,
Daniel Machon, Steen Hegelund, Luca Ceresoli, Thomas Petazzoni
The code set directly fwnode->dev field.
Use the dedicated fw_devlink_set_device() helper to perform this
operation.
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Linus Walleij <linusw@kernel.org>
---
drivers/pinctrl/cirrus/pinctrl-cs42l43.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/cirrus/pinctrl-cs42l43.c b/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
index 227c37c360e1..47f2873034ce 100644
--- a/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
+++ b/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
@@ -578,7 +578,7 @@ static int cs42l43_pin_probe(struct platform_device *pdev)
return ret;
if (!child->dev)
- child->dev = priv->dev;
+ fw_devlink_set_device(child, priv->dev);
fwnode = child;
}
}
--
2.54.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v7 4/8] cxl/test: Use device_set_node()
2026-05-11 15:59 [PATCH v7 0/8] lan966x pci device: Add support for SFPs, PCI part Herve Codina
` (2 preceding siblings ...)
2026-05-11 15:59 ` [PATCH v7 3/8] pinctrl: cs42l43: " Herve Codina
@ 2026-05-11 15:59 ` Herve Codina
2026-05-12 8:26 ` Andy Shevchenko
2026-05-11 15:59 ` [PATCH v7 5/8] cxl/test: Use fw_devlink_set_device() Herve Codina
` (3 subsequent siblings)
7 siblings, 1 reply; 11+ messages in thread
From: Herve Codina @ 2026-05-11 15:59 UTC (permalink / raw)
To: Andrew Lunn, Rob Herring, Saravana Kannan, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Bjorn Helgaas,
Charles Keepax, Richard Fitzgerald, David Rhodes, Linus Walleij,
Len Brown, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
Sakari Ailus, Davidlohr Bueso, Jonathan Cameron, Dave Jiang,
Alison Schofield, Vishal Verma, Ira Weiny, Dan Williams,
Lizhi Hou, Herve Codina
Cc: driver-core, linux-kernel, linux-pci, linux-sound, patches,
linux-gpio, linux-acpi, linux-cxl, Allan Nielsen, Horatiu Vultur,
Daniel Machon, Steen Hegelund, Luca Ceresoli, Thomas Petazzoni,
Jonathan Cameron
The code set directly dev->fwnode.
Use the dedicated helper to perform this operation.
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
---
tools/testing/cxl/test/cxl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/cxl/test/cxl.c b/tools/testing/cxl/test/cxl.c
index 418669927fb0..2fdf8c0eca10 100644
--- a/tools/testing/cxl/test/cxl.c
+++ b/tools/testing/cxl/test/cxl.c
@@ -1515,7 +1515,7 @@ static void mock_companion(struct acpi_device *adev, struct device *dev)
{
device_initialize(&adev->dev);
fwnode_init(&adev->fwnode, NULL);
- dev->fwnode = &adev->fwnode;
+ device_set_node(dev, &adev->fwnode);
adev->fwnode.dev = dev;
}
--
2.54.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v7 5/8] cxl/test: Use fw_devlink_set_device()
2026-05-11 15:59 [PATCH v7 0/8] lan966x pci device: Add support for SFPs, PCI part Herve Codina
` (3 preceding siblings ...)
2026-05-11 15:59 ` [PATCH v7 4/8] cxl/test: Use device_set_node() Herve Codina
@ 2026-05-11 15:59 ` Herve Codina
2026-05-12 8:27 ` Andy Shevchenko
2026-05-11 15:59 ` [PATCH v7 6/8] PCI: of: " Herve Codina
` (2 subsequent siblings)
7 siblings, 1 reply; 11+ messages in thread
From: Herve Codina @ 2026-05-11 15:59 UTC (permalink / raw)
To: Andrew Lunn, Rob Herring, Saravana Kannan, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Bjorn Helgaas,
Charles Keepax, Richard Fitzgerald, David Rhodes, Linus Walleij,
Len Brown, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
Sakari Ailus, Davidlohr Bueso, Jonathan Cameron, Dave Jiang,
Alison Schofield, Vishal Verma, Ira Weiny, Dan Williams,
Lizhi Hou, Herve Codina
Cc: driver-core, linux-kernel, linux-pci, linux-sound, patches,
linux-gpio, linux-acpi, linux-cxl, Allan Nielsen, Horatiu Vultur,
Daniel Machon, Steen Hegelund, Luca Ceresoli, Thomas Petazzoni,
Jonathan Cameron
The code set directly fwnode.dev field.
Use the dedicated fw_devlink_set_device() helper to perform this
operation.
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
---
tools/testing/cxl/test/cxl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/cxl/test/cxl.c b/tools/testing/cxl/test/cxl.c
index 2fdf8c0eca10..4c33b85dc846 100644
--- a/tools/testing/cxl/test/cxl.c
+++ b/tools/testing/cxl/test/cxl.c
@@ -1516,7 +1516,7 @@ static void mock_companion(struct acpi_device *adev, struct device *dev)
device_initialize(&adev->dev);
fwnode_init(&adev->fwnode, NULL);
device_set_node(dev, &adev->fwnode);
- adev->fwnode.dev = dev;
+ fw_devlink_set_device(&adev->fwnode, dev);
}
#ifndef SZ_64G
--
2.54.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v7 6/8] PCI: of: Use fw_devlink_set_device()
2026-05-11 15:59 [PATCH v7 0/8] lan966x pci device: Add support for SFPs, PCI part Herve Codina
` (4 preceding siblings ...)
2026-05-11 15:59 ` [PATCH v7 5/8] cxl/test: Use fw_devlink_set_device() Herve Codina
@ 2026-05-11 15:59 ` Herve Codina
2026-05-11 15:59 ` [PATCH v7 7/8] PCI: of: Set fwnode device of newly created PCI device nodes Herve Codina
2026-05-11 15:59 ` [PATCH v7 8/8] PCI: of: Remove fwnode_dev_initialized() call for a PCI root bridge node Herve Codina
7 siblings, 0 replies; 11+ messages in thread
From: Herve Codina @ 2026-05-11 15:59 UTC (permalink / raw)
To: Andrew Lunn, Rob Herring, Saravana Kannan, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Bjorn Helgaas,
Charles Keepax, Richard Fitzgerald, David Rhodes, Linus Walleij,
Len Brown, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
Sakari Ailus, Davidlohr Bueso, Jonathan Cameron, Dave Jiang,
Alison Schofield, Vishal Verma, Ira Weiny, Dan Williams,
Lizhi Hou, Herve Codina
Cc: driver-core, linux-kernel, linux-pci, linux-sound, patches,
linux-gpio, linux-acpi, linux-cxl, Allan Nielsen, Horatiu Vultur,
Daniel Machon, Steen Hegelund, Luca Ceresoli, Thomas Petazzoni,
stable
The code set directly fwnode.dev field.
Use the dedicated fw_devlink_set_device() helper to perform this
operation.
Cc: stable@vger.kernel.org
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
---
Cc stable because used by other patches with Fixes + Cc stable
---
drivers/pci/of.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/of.c b/drivers/pci/of.c
index 6da569fd3b8f..7506208815a4 100644
--- a/drivers/pci/of.c
+++ b/drivers/pci/of.c
@@ -803,7 +803,7 @@ void of_pci_make_host_bridge_node(struct pci_host_bridge *bridge)
* bus. Avoid any new device creation.
*/
of_node_set_flag(np, OF_POPULATED);
- np->fwnode.dev = &bridge->dev;
+ fw_devlink_set_device(&np->fwnode, &bridge->dev);
fwnode_dev_initialized(&np->fwnode, true);
ret = of_changeset_apply(cset);
--
2.54.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v7 7/8] PCI: of: Set fwnode device of newly created PCI device nodes
2026-05-11 15:59 [PATCH v7 0/8] lan966x pci device: Add support for SFPs, PCI part Herve Codina
` (5 preceding siblings ...)
2026-05-11 15:59 ` [PATCH v7 6/8] PCI: of: " Herve Codina
@ 2026-05-11 15:59 ` Herve Codina
2026-05-11 15:59 ` [PATCH v7 8/8] PCI: of: Remove fwnode_dev_initialized() call for a PCI root bridge node Herve Codina
7 siblings, 0 replies; 11+ messages in thread
From: Herve Codina @ 2026-05-11 15:59 UTC (permalink / raw)
To: Andrew Lunn, Rob Herring, Saravana Kannan, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Bjorn Helgaas,
Charles Keepax, Richard Fitzgerald, David Rhodes, Linus Walleij,
Len Brown, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
Sakari Ailus, Davidlohr Bueso, Jonathan Cameron, Dave Jiang,
Alison Schofield, Vishal Verma, Ira Weiny, Dan Williams,
Lizhi Hou, Herve Codina
Cc: driver-core, linux-kernel, linux-pci, linux-sound, patches,
linux-gpio, linux-acpi, linux-cxl, Allan Nielsen, Horatiu Vultur,
Daniel Machon, Steen Hegelund, Luca Ceresoli, Thomas Petazzoni,
stable
Device-tree node can be created when CONFIG_PCI_DYNAMIC_OF_NODES. Those
nodes are created and filled based on PCI core information but the
fwnode device field is not set.
When later an overlay is applied, this confuses fw_devlink. Indeed,
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.
Fixes: 407d1a51921e ("PCI: Create device tree node for bridge")
Cc: stable@vger.kernel.org
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
---
drivers/pci/of.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/pci/of.c b/drivers/pci/of.c
index 7506208815a4..25fb02c3dc72 100644
--- a/drivers/pci/of.c
+++ b/drivers/pci/of.c
@@ -709,6 +709,13 @@ void of_pci_make_dev_node(struct pci_dev *pdev)
if (ret)
goto out_free_node;
+ /*
+ * Set the fwnode device in order to have fw_devlink creating links
+ * pointing to this PCI device instead of walking up to the PCI host
+ * bridge.
+ */
+ fw_devlink_set_device(&np->fwnode, &pdev->dev);
+
ret = of_changeset_apply(cset);
if (ret)
goto out_free_node;
--
2.54.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v7 8/8] PCI: of: Remove fwnode_dev_initialized() call for a PCI root bridge node
2026-05-11 15:59 [PATCH v7 0/8] lan966x pci device: Add support for SFPs, PCI part Herve Codina
` (6 preceding siblings ...)
2026-05-11 15:59 ` [PATCH v7 7/8] PCI: of: Set fwnode device of newly created PCI device nodes Herve Codina
@ 2026-05-11 15:59 ` Herve Codina
7 siblings, 0 replies; 11+ messages in thread
From: Herve Codina @ 2026-05-11 15:59 UTC (permalink / raw)
To: Andrew Lunn, Rob Herring, Saravana Kannan, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Bjorn Helgaas,
Charles Keepax, Richard Fitzgerald, David Rhodes, Linus Walleij,
Len Brown, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
Sakari Ailus, Davidlohr Bueso, Jonathan Cameron, Dave Jiang,
Alison Schofield, Vishal Verma, Ira Weiny, Dan Williams,
Lizhi Hou, Herve Codina
Cc: driver-core, linux-kernel, linux-pci, linux-sound, patches,
linux-gpio, linux-acpi, linux-cxl, Allan Nielsen, Horatiu Vultur,
Daniel Machon, Steen Hegelund, Luca Ceresoli, Thomas Petazzoni,
stable
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.
Fixes: 1f340724419e ("PCI: of: Create device tree PCI host bridge node")
Cc: stable@vger.kernel.org
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
---
drivers/pci/of.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/pci/of.c b/drivers/pci/of.c
index 25fb02c3dc72..53a8a4f30eb6 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.54.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v7 4/8] cxl/test: Use device_set_node()
2026-05-11 15:59 ` [PATCH v7 4/8] cxl/test: Use device_set_node() Herve Codina
@ 2026-05-12 8:26 ` Andy Shevchenko
0 siblings, 0 replies; 11+ messages in thread
From: Andy Shevchenko @ 2026-05-12 8:26 UTC (permalink / raw)
To: Herve Codina
Cc: Andrew Lunn, Rob Herring, Saravana Kannan, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Bjorn Helgaas,
Charles Keepax, Richard Fitzgerald, David Rhodes, Linus Walleij,
Len Brown, Daniel Scally, Heikki Krogerus, Sakari Ailus,
Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
Vishal Verma, Ira Weiny, Dan Williams, Lizhi Hou, driver-core,
linux-kernel, linux-pci, linux-sound, patches, linux-gpio,
linux-acpi, linux-cxl, Allan Nielsen, Horatiu Vultur,
Daniel Machon, Steen Hegelund, Luca Ceresoli, Thomas Petazzoni,
Jonathan Cameron
On Mon, May 11, 2026 at 05:59:24PM +0200, Herve Codina wrote:
> The code set directly dev->fwnode.
>
> Use the dedicated helper to perform this operation.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v7 5/8] cxl/test: Use fw_devlink_set_device()
2026-05-11 15:59 ` [PATCH v7 5/8] cxl/test: Use fw_devlink_set_device() Herve Codina
@ 2026-05-12 8:27 ` Andy Shevchenko
0 siblings, 0 replies; 11+ messages in thread
From: Andy Shevchenko @ 2026-05-12 8:27 UTC (permalink / raw)
To: Herve Codina
Cc: Andrew Lunn, Rob Herring, Saravana Kannan, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Bjorn Helgaas,
Charles Keepax, Richard Fitzgerald, David Rhodes, Linus Walleij,
Len Brown, Daniel Scally, Heikki Krogerus, Sakari Ailus,
Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
Vishal Verma, Ira Weiny, Dan Williams, Lizhi Hou, driver-core,
linux-kernel, linux-pci, linux-sound, patches, linux-gpio,
linux-acpi, linux-cxl, Allan Nielsen, Horatiu Vultur,
Daniel Machon, Steen Hegelund, Luca Ceresoli, Thomas Petazzoni,
Jonathan Cameron
On Mon, May 11, 2026 at 05:59:25PM +0200, Herve Codina wrote:
> The code set directly fwnode.dev field.
>
> Use the dedicated fw_devlink_set_device() helper to perform this
> operation.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2026-05-12 8:27 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-11 15:59 [PATCH v7 0/8] lan966x pci device: Add support for SFPs, PCI part Herve Codina
2026-05-11 15:59 ` [PATCH v7 1/8] driver core: fw_devlink: Introduce fw_devlink_set_device() Herve Codina
2026-05-11 15:59 ` [PATCH v7 2/8] drivers: core: Use fw_devlink_set_device() Herve Codina
2026-05-11 15:59 ` [PATCH v7 3/8] pinctrl: cs42l43: " Herve Codina
2026-05-11 15:59 ` [PATCH v7 4/8] cxl/test: Use device_set_node() Herve Codina
2026-05-12 8:26 ` Andy Shevchenko
2026-05-11 15:59 ` [PATCH v7 5/8] cxl/test: Use fw_devlink_set_device() Herve Codina
2026-05-12 8:27 ` Andy Shevchenko
2026-05-11 15:59 ` [PATCH v7 6/8] PCI: of: " Herve Codina
2026-05-11 15:59 ` [PATCH v7 7/8] PCI: of: Set fwnode device of newly created PCI device nodes Herve Codina
2026-05-11 15:59 ` [PATCH v7 8/8] PCI: of: Remove fwnode_dev_initialized() call for a PCI root bridge node Herve Codina
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox