public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 00/28] lan966x pci device: Add support for SFPs
@ 2026-02-27 13:53 Herve Codina
  2026-02-27 13:53 ` [PATCH v5 01/28] Revert "treewide: Fix probing of devices in DT overlays" Herve Codina
                   ` (27 more replies)
  0 siblings, 28 replies; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:53 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, Steen Hegelund, Luca Ceresoli,
	Thomas Petazzoni

Hi,

This series add support for SFPs ports available on the LAN966x PCI
device. In order to have the SFPs supported, additional devices are
needed such as clock controller and I2C.

As a reminder, the LAN966x PCI device driver use a device-tree overlay
to describe devices available on the PCI board. Adding support for SFPs
ports consists in adding more devices in the already existing
device-tree overlay.

With those devices added, the device-tree overlay is more complex and
some consumer/supplier relationship are needed in order to remove
devices in correct order when the LAN966x PCI driver is removed.

Those links are typically provided by fw_devlink and we faced some
issues with fw_devlink and overlays.

This series gives the big picture related to the SFPs support from
fixing issues to adding new devices. Of course, it can be split if
needed.

The first part of the series (patch 1, 2 and 3) fixes fw_devlink when it
is used with overlay. Patches 1 and 3 were previously sent by Saravana
[0]. I rebased them on top of v7.0-rc1 and added patch 2 in order to
take into account feedback received on the series sent by Saravana.

Also I added a call to driver_deferred_probe_trigger() in Saravana's
patch (patch 3) to ensure that probes are retried after the modification
performed on the dangling consumers. This allows to fix issues reported
by Matti and Geert [2] with the previous iteration patches.

Those modification were not sufficient in our case and so, on top of
that, patches 4 to 6 fix some more issues related to fw_devlink.

Patches 7 to 12 introduce and use fw_devlink_set_device() in already
existing code.

Patches 13 and 14 are related also to fw_devlink but specific to PCI and
the device-tree nodes created during enumeration.

Patches 15, 16 and 17 are related fw_devlink too but specific to I2C
muxes. Patches purpose is to correctly set a link between an adapter
supplier and its consumer. Indeed, an i2c mux adapter's parent is not
the i2c mux supplier but the adapter the i2c mux is connected to. Adding
a new link between the adapter supplier involved when i2c muxes are used
avoid a freeze observed during device removal.

Patch 18 adds support for fw_delink on x86. fw_devlink is needed to have
the consumer/supplier relationship between devices in order to ensure a
correct device removal order. Adding fw_devlink support for x86 has been
tried in the past but was reverted [1] because it broke some systems.
Instead of enabling fw_devlink on *all* x86 system, enable it on *all*
x86 except on those where it leads to issue.

Patches 19 and 20 allow to build clock and i2c controller used by the
LAN966x PCI device when the LAN966x PCI device is enabled.

Patches 21 to 25 are specific to the LAN966x. They touch the current
dtso, split it in dtsi/dtso files, rename the dtso and improve the
driver to allow easier support for other boards.

The next patch (patch 26) update the LAN966x device-tree overlay itself
to have the SPF ports and devices they depends on described.

The last two patches (patches 27 and 29) sort the existing drivers in
the needed driver list available in the Kconfig help and add new drivers
in this list keep the list up to date with the devices described in the
device-tree overlay.

We believe some items from the above list can be merged separately, with
no build dependencies. We expect:

 - Patches 1 to 6 to be taken by driver core maintainers

 - Patches 7 to 12 to be taken by driver core maintainers

 - Patches 13 and 14 to be taken by driver core or PCI maintainers
  (depend on patch 7)

 - Patches 15 to 17 to be taken by I2C maintainers

 - Patch 18 to be taken by driver core or OF maintainers

 - Patch 19 to be taken by clock maintainers

 - Patch 20 to be taken by I2C maintainers

 - Patches 21 to 28 to be taken by misc maintainers

Once again, this series gives the big picture and can be split if
needed. Let me know.

Compare to previous iteration, this v5 series mainly:
 - Handle Matti and Geert use cases [2]
 - Remove simple-platform-bus driver introduced in v4 and switch the
   simple-bus modification back to what was proposed in v3. In the v4
   iteration, conclusion was to use v3 changes [3].

[0] https://lore.kernel.org/lkml/20240411235623.1260061-1-saravanak@google.com/
[1] https://lore.kernel.org/lkml/3c1f2473-92ad-bfc4-258e-a5a08ad73dd0@web.de/
[2] https://lore.kernel.org/all/072dde7c-a53c-4525-83ac-57ea38edc0b5@gmail.com/
[3] https://lore.kernel.org/lkml/20251114083056.31553866@bootlin.com/

Best regards,
Hervé

Changes:

v4 -> v5
  v4: https://lore.kernel.org/lkml/20251015071420.1173068-1-herve.codina@bootlin.com/

  - Patch 2:
    Add 'Acked-by: Ulf Hansson'

  - Patch 3:
    Add a call to driver_deferred_probe_trigger()

  - Patch 5: (new patch)
    Depopulate devices at remove

  - Patch 6:
    Populate devices at probe.
    Switched back to modification proposed in v3

  - Patch 7 in v3 removed

  - Patch 7 (8 in v4):
    Add 'Reviewed-by: Andy Shevchenko'
    Add 'Reviewed-by: Ulf Hansson'

  - Patch 8 (9 in v4):
    Add 'Reviewed-by: Ulf Hansson'

  - Patches 9 to 15 (10 to 16 in v3)
    No changes

  - Patch 16 (17 in v4):
    Add 'Reviewed-by: Andi Shyti'

  - Patch 17 (18 in v4):
    Change an error code from -EINVAL to -ENODEV
    Add a blank line and fix a typo in commit log

  - Patch 18 (19 in v4):
    Simplify of_is_fwnode_add_links_supported().
    Move IS_ENABLED(CONFIG_X86) check in of_is_fwnode_add_links_supported().

  - Patches 19 to 21 (20 to 22 in v4)
    No changes

  - Patch 22 (23 in v4)
    Update due to simple-platform-bus removal

  - Patches 23 to 28 (24 to 29 in v4)
    No changes

v3 -> v4
  v3: https://lore.kernel.org/lkml/20250613134817.681832-1-herve.codina@bootlin.com/

  - Patch 1:
    No change

  - Patch 2:
    Update and fix conflicts. Indeed, since v3 iteration
    get_dev_from_fwnode() has been moved to device.h and used by
    pmdomain/core.c.

  - Patch 3:
    remove '#define get_device_from_fwnode()'

  - Patch 4:
    Fix conflict (rebase v6.17-rc6)
    Add 'Reviewed-by: Rafael J. Wysocki'
    Add 'Reviewed-by: Saravana Kannan'

  - Patch 5 (new in v4):
    Introduce simple-platform-bus (binding)

  - Patch 6 (5 in v3):
    Rework patch and introduce simple-platform-bus

  - Patch 7: (new)
    Use simple-platform-bus in LAN966x

  - Patch 8 (6 in v3):
    - No change

  - Patch 9 and 10 (7 and 8 in v3):
    Add 'Reviewed-by: Andy Shevchenko'

  - Patch 11 and 12 (9 and 10 in v3):
    Add 'Reviewed-by: Dave Jiang'

  - Patch 13 (11 in v3):
    Add 'Reviewed-by: Andy Shevchenko'

  - Patch 12 in v3:
    Patch removed.
    Adding __private tag in fwnode.dev is going to be handled in a
    dedicated series. Indeed a test robot reported an issue and more
    patches are needed (I have missed fwnode.dev users in several part
    in the kernel).

  - Patch 14 and 15 (13 and 14 in v3):
    No change

  - Patch 16 (14 in v3):
    Add 'Reviewed-by: Andi Shyti'

  - Patch 17 and 18 (16 and 17 in v3):
    No change

  - Patch 19 (18 in v3):
    Filter out support for fw_devlink on x86 based on some device-tree
    properties.
    Rewrite commit changelog
    Remove 'Reviewed-by: Andy Shevchenko' (significant modification)

  - Patch 20 (19 in v3):
    Add 'Acked-by: Stephen Boyd'

  - Patch 21 (20 in v3):
    Fix conflict (rebase v6.18-rc1)

  - Patches 22 to 24 (21 to 23 in v3):
    No change

  - Patch 25 (24 in v3):
    Fix conflict (rebase v6.18-rc1)
    Add 'Acked-by: Bjorn Helgaas'

  - Patches 26 to 29 (25 to 28 in v3):
    No change

v2 -> v3
  v2: https://lore.kernel.org/all/20250507071315.394857-1-herve.codina@bootlin.com/

  - Patch 1:
    Add 'Acked-by: Mark Brown'

  - Patch 2 and 3:
    No changes

  - Patch 4:
    Rewrite the WARN_ON() condition to avoid an additional 'if'

  - Patch 5:
    Fix typos in commit log
    Update a comment
    Remove the unneeded check before calling of_platform_depopulate()

  - Patches 6 to 11:
    No changes

  - Patch 12 (new in v3)
    Tag the fwnode dev member as private

  - Patch 13 (12 in v2)
    Fix a typo in the commit log

  - Patches 14 to 16 (13 to 15 in v2)
    No changes

  - Patch 17 (16 in v2)
    Check parent_physdev for NULL

  - Patch 18 (17 in v2)
    Capitalize "Link:"
    Add 'Reviewed-by: Andy Shevchenko'

  - Patch 19 (18 in v2)
    No changes

  - Patch 20 (19 in v2)
    Add 'Acked-by: Andi Shyti'

  - Patch 21 (20 in v2)
    No changes

  - Patch 22 (21 in v2)
    Add 'Reviewed-by: Andrew Lunn'

  - Patch 23 (22 in v2)
    Add 'Reviewed-by: Andrew Lunn'

  - Patch 24 (new in v3)
    Introduce PCI_DEVICE_ID_EFAR_LAN9662, the LAN966x PCI device ID

  - Patch 25 (23 in v2)
    Add 'Reviewed-by: Andrew Lunn'
    Use PCI_DEVICE_DATA() with PCI_DEVICE_ID_EFAR_LAN9662 instead of
    PCI_VDEVICE()

  - Patch 26 to 28 (24 to 26 in v2)
    No changes

v1 -> v2
  v1: https://lore.kernel.org/lkml/20250407145546.270683-1-herve.codina@bootlin.com/

  - Patch 1 and 3
    Remove 'From' tag from the commit log

  - Patch 2
    Add 'Reviewed-by: Andy Shevchenko'
    Add 'Reviewed-by: Saravana Kannan'
    Add 'Reviewed-by: Luca Ceresoli'

  - Patch 4 and 5
    No changes

  - Patch 6 (new in v2)
    Introduce fw_devlink_set_device()

  - Patch 7 (new in v2)
    Use existing device_set_node() helper.

  - Patch 8 to 11 (new in v2)
    Use fw_devlink_set_device() in existing code.

  - Patch 12 (6 in v1)
    Use fw_devlink_add_device()

  - Patch 13 (7 in v1)
    No changes

  - Patch 14 (8 in v1)
    Update commit log
    Use 'physdev' instead of 'supplier'
    Minor fixes in i2c_get_adapter_physdev() kdoc

  - Patch 15 and 16 (9 and 10 in v1)
    Use 'physdev' instead of 'supplier' (commit log, title and code)

  - Patch 17 (11 in v2)
    Enable fw_devlink on x86 only if PCI_DYNAMIC_OF_NODES is enabled.
    Rework commit log.

  - Patch 18, 19 and 20 (12, 13 and 14 in v1)
    No changes

  - Patch 21 (new in v2)
    Split dtso in dtsi/dtso

  - Patch 22 (new in v2)
    Rename lan966x_pci.dtso using the specific board name

  - Patch 23 (new in v2)
    Improve the driver introducing board specific data to ease support
    for other boards (avoid the direct dtbo reference in the function
    loading the dtbo).

  - Patch 24 (15 in v1)
    Refactor due to dtso split in dtsi/dtso

  - Patch 25 (new in v2)
    Sort exist driver list in Kconfig help

  - Patch 26 (16 in v1)
    Keep alphanumeric order for new drivers added in Kconfig help

Herve Codina (26):
  driver core: Rename get_dev_from_fwnode() wrapper to
    get_device_from_fwnode()
  driver core: Avoid warning when removing a device while its supplier
    is unbinding
  bus: simple-pm-bus: Remove child devices when the bus is unbound
  bus: simple-pm-bus: Populate child nodes at probe
  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
  i2c: core: Introduce i2c_get_adapter_physdev()
  i2c: mux: Set adapter physical device
  i2c: mux: Create missing devlink between mux and adapter physical
    device
  of: property: Allow fw_devlink device-tree on x86
  clk: lan966x: Add MCHP_LAN966X_PCI dependency
  i2c: busses: at91: Add MCHP_LAN966X_PCI dependency
  misc: lan966x_pci: Fix dtso nodes ordering
  misc: lan966x_pci: Split dtso in dtsi/dtso
  misc: lan966x_pci: Rename lan966x_pci.dtso to
    lan966x_evb_lan9662_nic.dtso
  PCI: Add Microchip LAN9662 PCI Device ID
  misc: lan966x_pci: Introduce board specific data
  misc: lan966x_pci: Add dtsi/dtso nodes in order to support SFPs
  misc: lan966x_pci: Sort the drivers list in Kconfig help
  misc: lan966x_pci: Add drivers needed to support SFPs in Kconfig help

Saravana Kannan (2):
  Revert "treewide: Fix probing of devices in DT overlays"
  of: dynamic: Fix overlayed devices not probing because of fw_devlink

 MAINTAINERS                               |   3 +-
 drivers/base/core.c                       | 108 ++++++++++---
 drivers/bus/imx-weim.c                    |   6 -
 drivers/bus/simple-pm-bus.c               |  24 +--
 drivers/clk/Kconfig                       |   2 +-
 drivers/i2c/busses/Kconfig                |   2 +-
 drivers/i2c/i2c-core-base.c               |  16 ++
 drivers/i2c/i2c-core-of.c                 |   5 -
 drivers/i2c/i2c-mux.c                     |  26 ++++
 drivers/misc/Kconfig                      |  11 +-
 drivers/misc/Makefile                     |   2 +-
 drivers/misc/lan966x_evb_lan9662_nic.dtso | 167 ++++++++++++++++++++
 drivers/misc/lan966x_pci.c                |  30 +++-
 drivers/misc/lan966x_pci.dtsi             | 172 +++++++++++++++++++++
 drivers/misc/lan966x_pci.dtso             | 177 ----------------------
 drivers/of/dynamic.c                      |   1 -
 drivers/of/overlay.c                      |  15 ++
 drivers/of/platform.c                     |   5 -
 drivers/of/property.c                     |  26 +++-
 drivers/pci/of.c                          |  10 +-
 drivers/pci/quirks.c                      |   2 +-
 drivers/pinctrl/cirrus/pinctrl-cs42l43.c  |   2 +-
 drivers/pmdomain/core.c                   |   4 +-
 drivers/spi/spi.c                         |   5 -
 include/linux/device.h                    |   2 +-
 include/linux/fwnode.h                    |   7 +
 include/linux/i2c.h                       |   3 +
 include/linux/pci_ids.h                   |   1 +
 tools/testing/cxl/test/cxl.c              |   4 +-
 29 files changed, 584 insertions(+), 254 deletions(-)
 create mode 100644 drivers/misc/lan966x_evb_lan9662_nic.dtso
 create mode 100644 drivers/misc/lan966x_pci.dtsi
 delete mode 100644 drivers/misc/lan966x_pci.dtso

-- 
2.53.0


^ permalink raw reply	[flat|nested] 46+ messages in thread

* [PATCH v5 01/28] Revert "treewide: Fix probing of devices in DT overlays"
  2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
@ 2026-02-27 13:53 ` Herve Codina
  2026-02-27 13:53 ` [PATCH v5 02/28] driver core: Rename get_dev_from_fwnode() wrapper to get_device_from_fwnode() Herve Codina
                   ` (26 subsequent siblings)
  27 siblings, 0 replies; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:53 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, Steen Hegelund, Luca Ceresoli,
	Thomas Petazzoni, Saravana Kannan

From: Saravana Kannan <saravanak@google.com>

This reverts commit 1a50d9403fb90cbe4dea0ec9fd0351d2ecbd8924.

While the commit fixed fw_devlink overlay handling for one case, it
broke it for another case. So revert it and redo the fix in a separate
patch.

Fixes: 1a50d9403fb9 ("treewide: Fix probing of devices in DT overlays")
Reported-by: Herve Codina <herve.codina@bootlin.com>
Closes: https://lore.kernel.org/lkml/CAMuHMdXEnSD4rRJ-o90x4OprUacN_rJgyo8x6=9F9rZ+-KzjOg@mail.gmail.com/
Closes: https://lore.kernel.org/all/20240221095137.616d2aaa@bootlin.com/
Closes: https://lore.kernel.org/lkml/20240312151835.29ef62a0@bootlin.com/
Signed-off-by: Saravana Kannan <saravanak@google.com>
Link: https://lore.kernel.org/lkml/20240411235623.1260061-2-saravanak@google.com/
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Acked-by: Mark Brown <broonie@kernel.org>
---
 drivers/bus/imx-weim.c    | 6 ------
 drivers/i2c/i2c-core-of.c | 5 -----
 drivers/of/dynamic.c      | 1 -
 drivers/of/platform.c     | 5 -----
 drivers/spi/spi.c         | 5 -----
 5 files changed, 22 deletions(-)

diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c
index 83d623d97f5f..87070155b057 100644
--- a/drivers/bus/imx-weim.c
+++ b/drivers/bus/imx-weim.c
@@ -327,12 +327,6 @@ static int of_weim_notify(struct notifier_block *nb, unsigned long action,
 				 "Failed to setup timing for '%pOF'\n", rd->dn);
 
 		if (!of_node_check_flag(rd->dn, OF_POPULATED)) {
-			/*
-			 * Clear the flag before adding the device so that
-			 * fw_devlink doesn't skip adding consumers to this
-			 * device.
-			 */
-			rd->dn->fwnode.flags &= ~FWNODE_FLAG_NOT_DEVICE;
 			if (!of_platform_device_create(rd->dn, NULL, &pdev->dev)) {
 				dev_err(&pdev->dev,
 					"Failed to create child device '%pOF'\n",
diff --git a/drivers/i2c/i2c-core-of.c b/drivers/i2c/i2c-core-of.c
index eb7fb202355f..30b48a428c0b 100644
--- a/drivers/i2c/i2c-core-of.c
+++ b/drivers/i2c/i2c-core-of.c
@@ -176,11 +176,6 @@ static int of_i2c_notify(struct notifier_block *nb, unsigned long action,
 			return NOTIFY_OK;
 		}
 
-		/*
-		 * Clear the flag before adding the device so that fw_devlink
-		 * doesn't skip adding consumers to this device.
-		 */
-		rd->dn->fwnode.flags &= ~FWNODE_FLAG_NOT_DEVICE;
 		client = of_i2c_register_device(adap, rd->dn);
 		if (IS_ERR(client)) {
 			dev_err(&adap->dev, "failed to create client for '%pOF'\n",
diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c
index 1a06175def37..aa450425ec1e 100644
--- a/drivers/of/dynamic.c
+++ b/drivers/of/dynamic.c
@@ -225,7 +225,6 @@ static void __of_attach_node(struct device_node *np)
 	np->sibling = np->parent->child;
 	np->parent->child = np;
 	of_node_clear_flag(np, OF_DETACHED);
-	np->fwnode.flags |= FWNODE_FLAG_NOT_DEVICE;
 
 	raw_spin_unlock_irqrestore(&devtree_lock, flags);
 
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index ba591fbceb56..2037c0b3880d 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -738,11 +738,6 @@ static int of_platform_notify(struct notifier_block *nb,
 		if (of_node_check_flag(rd->dn, OF_POPULATED))
 			return NOTIFY_OK;
 
-		/*
-		 * Clear the flag before adding the device so that fw_devlink
-		 * doesn't skip adding consumers to this device.
-		 */
-		rd->dn->fwnode.flags &= ~FWNODE_FLAG_NOT_DEVICE;
 		/* pdev_parent may be NULL when no bus platform device */
 		pdev_parent = of_find_device_by_node(parent);
 		pdev = of_platform_device_create(rd->dn, NULL,
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 61f7bde8c7fb..749d306ce1cc 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -4934,11 +4934,6 @@ static int of_spi_notify(struct notifier_block *nb, unsigned long action,
 			return NOTIFY_OK;
 		}
 
-		/*
-		 * Clear the flag before adding the device so that fw_devlink
-		 * doesn't skip adding consumers to this device.
-		 */
-		rd->dn->fwnode.flags &= ~FWNODE_FLAG_NOT_DEVICE;
 		spi = of_register_spi_device(ctlr, rd->dn);
 		put_device(&ctlr->dev);
 
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v5 02/28] driver core: Rename get_dev_from_fwnode() wrapper to get_device_from_fwnode()
  2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
  2026-02-27 13:53 ` [PATCH v5 01/28] Revert "treewide: Fix probing of devices in DT overlays" Herve Codina
@ 2026-02-27 13:53 ` Herve Codina
  2026-03-10 15:03   ` Geert Uytterhoeven
  2026-02-27 13:54 ` [PATCH v5 03/28] of: dynamic: Fix overlayed devices not probing because of fw_devlink Herve Codina
                   ` (25 subsequent siblings)
  27 siblings, 1 reply; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:53 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, Steen Hegelund, Luca Ceresoli,
	Thomas Petazzoni, Saravana Kannan

get_dev_from_fwnode() calls get_device() and so it acquires a reference
on the device returned.

In order to be more obvious that this wrapper is a get_device() variant,
rename it to get_device_from_fwnode().

Suggested-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/lkml/CAGETcx97QjnjVR8Z5g0ndLHpK96hLd4aYSV=iEkKPNbNOccYmA@mail.gmail.com/
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Saravana Kannan <saravanak@google.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/base/core.c     | 18 +++++++++---------
 drivers/pmdomain/core.c |  4 ++--
 include/linux/device.h  |  2 +-
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index 791f9e444df8..33c0ff2b162d 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1888,7 +1888,7 @@ static bool fwnode_init_without_drv(struct fwnode_handle *fwnode)
 	if (!(fwnode->flags & FWNODE_FLAG_INITIALIZED))
 		return false;
 
-	dev = get_dev_from_fwnode(fwnode);
+	dev = get_device_from_fwnode(fwnode);
 	ret = !dev || dev->links.status == DL_DEV_NO_DRIVER;
 	put_device(dev);
 
@@ -1957,7 +1957,7 @@ static struct device *fwnode_get_next_parent_dev(const struct fwnode_handle *fwn
 	struct device *dev;
 
 	fwnode_for_each_parent_node(fwnode, parent) {
-		dev = get_dev_from_fwnode(parent);
+		dev = get_device_from_fwnode(parent);
 		if (dev) {
 			fwnode_handle_put(parent);
 			return dev;
@@ -2013,8 +2013,8 @@ static bool __fw_devlink_relax_cycles(struct fwnode_handle *con_handle,
 		goto out;
 	}
 
-	sup_dev = get_dev_from_fwnode(sup_handle);
-	con_dev = get_dev_from_fwnode(con_handle);
+	sup_dev = get_device_from_fwnode(sup_handle);
+	con_dev = get_device_from_fwnode(con_handle);
 	/*
 	 * If sup_dev is bound to a driver and @con hasn't started binding to a
 	 * driver, sup_dev can't be a consumer of @con. So, no need to check
@@ -2153,7 +2153,7 @@ static int fw_devlink_create_devlink(struct device *con,
 	if (sup_handle->flags & FWNODE_FLAG_NOT_DEVICE)
 		sup_dev = fwnode_get_next_parent_dev(sup_handle);
 	else
-		sup_dev = get_dev_from_fwnode(sup_handle);
+		sup_dev = get_device_from_fwnode(sup_handle);
 
 	if (sup_dev) {
 		/*
@@ -2222,7 +2222,7 @@ static void __fw_devlink_link_to_consumers(struct device *dev)
 		bool own_link = true;
 		int ret;
 
-		con_dev = get_dev_from_fwnode(link->consumer);
+		con_dev = get_device_from_fwnode(link->consumer);
 		/*
 		 * If consumer device is not available yet, make a "proxy"
 		 * SYNC_STATE_ONLY link from the consumer's parent device to
@@ -5278,7 +5278,7 @@ void device_set_node(struct device *dev, struct fwnode_handle *fwnode)
 EXPORT_SYMBOL_GPL(device_set_node);
 
 /**
- * get_dev_from_fwnode - Obtain a reference count of the struct device the
+ * get_device_from_fwnode - Obtain a reference count of the struct device the
  * struct fwnode_handle is associated with.
  * @fwnode: The pointer to the struct fwnode_handle to obtain the struct device
  * reference count of.
@@ -5296,11 +5296,11 @@ EXPORT_SYMBOL_GPL(device_set_node);
  * This is possible since struct fwnode_handle has its own reference count and
  * hence can out-live the struct device it is associated with.
  */
-struct device *get_dev_from_fwnode(struct fwnode_handle *fwnode)
+struct device *get_device_from_fwnode(struct fwnode_handle *fwnode)
 {
 	return get_device((fwnode)->dev);
 }
-EXPORT_SYMBOL_GPL(get_dev_from_fwnode);
+EXPORT_SYMBOL_GPL(get_device_from_fwnode);
 
 int device_match_name(struct device *dev, const void *name)
 {
diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c
index 52ea84e548ff..444008234b05 100644
--- a/drivers/pmdomain/core.c
+++ b/drivers/pmdomain/core.c
@@ -2686,7 +2686,7 @@ int of_genpd_add_provider_simple(struct device_node *np,
 	genpd->dev.of_node = np;
 
 	fwnode = of_fwnode_handle(np);
-	dev = get_dev_from_fwnode(fwnode);
+	dev = get_device_from_fwnode(fwnode);
 	if (!dev && !genpd_is_no_sync_state(genpd)) {
 		genpd->sync_state = GENPD_SYNC_STATE_SIMPLE;
 		device_set_node(&genpd->dev, fwnode);
@@ -2761,7 +2761,7 @@ int of_genpd_add_provider_onecell(struct device_node *np,
 		data->xlate = genpd_xlate_onecell;
 
 	fwnode = of_fwnode_handle(np);
-	dev = get_dev_from_fwnode(fwnode);
+	dev = get_device_from_fwnode(fwnode);
 	if (!dev)
 		sync_state = true;
 	else
diff --git a/include/linux/device.h b/include/linux/device.h
index 0be95294b6e6..fd08e55e05de 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -1071,7 +1071,7 @@ void device_set_node(struct device *dev, struct fwnode_handle *fwnode);
 int device_add_of_node(struct device *dev, struct device_node *of_node);
 void device_remove_of_node(struct device *dev);
 void device_set_of_node_from_dev(struct device *dev, const struct device *dev2);
-struct device *get_dev_from_fwnode(struct fwnode_handle *fwnode);
+struct device *get_device_from_fwnode(struct fwnode_handle *fwnode);
 
 static inline struct device_node *dev_of_node(struct device *dev)
 {
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v5 03/28] of: dynamic: Fix overlayed devices not probing because of fw_devlink
  2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
  2026-02-27 13:53 ` [PATCH v5 01/28] Revert "treewide: Fix probing of devices in DT overlays" Herve Codina
  2026-02-27 13:53 ` [PATCH v5 02/28] driver core: Rename get_dev_from_fwnode() wrapper to get_device_from_fwnode() Herve Codina
@ 2026-02-27 13:54 ` Herve Codina
  2026-02-27 16:50   ` Geert Uytterhoeven
  2026-03-03 14:58   ` Kalle Niemi
  2026-02-27 13:54 ` [PATCH v5 04/28] driver core: Avoid warning when removing a device while its supplier is unbinding Herve Codina
                   ` (24 subsequent siblings)
  27 siblings, 2 replies; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, Steen Hegelund, Luca Ceresoli,
	Thomas Petazzoni, Saravana Kannan

From: Saravana Kannan <saravanak@google.com>

When an overlay is applied, if the target device has already probed
successfully and bound to a device, then some of the fw_devlink logic
that ran when the device was probed needs to be rerun. This allows newly
created dangling consumers of the overlayed device tree nodes to be
moved to become consumers of the target device.

Fixes: 1a50d9403fb9 ("treewide: Fix probing of devices in DT overlays")
Reported-by: Herve Codina <herve.codina@bootlin.com>
Closes: https://lore.kernel.org/lkml/CAMuHMdXEnSD4rRJ-o90x4OprUacN_rJgyo8x6=9F9rZ+-KzjOg@mail.gmail.com/
Closes: https://lore.kernel.org/all/20240221095137.616d2aaa@bootlin.com/
Closes: https://lore.kernel.org/lkml/20240312151835.29ef62a0@bootlin.com/
Signed-off-by: Saravana Kannan <saravanak@google.com>
Link: https://lore.kernel.org/lkml/20240411235623.1260061-3-saravanak@google.com/
[Herve: Rebase on top of recent kernel and use get_device_from_fwnode()]
[Herve: Add the call to driver_deferred_probe_trigger()]
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
 drivers/base/core.c    | 83 +++++++++++++++++++++++++++++++++++++-----
 drivers/of/overlay.c   | 15 ++++++++
 include/linux/fwnode.h |  1 +
 3 files changed, 90 insertions(+), 9 deletions(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index 33c0ff2b162d..726e4af9b1a6 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -235,6 +235,79 @@ static void __fw_devlink_pickup_dangling_consumers(struct fwnode_handle *fwnode,
 		__fw_devlink_pickup_dangling_consumers(child, new_sup);
 }
 
+static void fw_devlink_pickup_dangling_consumers(struct device *dev)
+{
+	struct fwnode_handle *child;
+
+	guard(mutex)(&fwnode_link_lock);
+
+	fwnode_for_each_available_child_node(dev->fwnode, child)
+		__fw_devlink_pickup_dangling_consumers(child, dev->fwnode);
+	__fw_devlink_link_to_consumers(dev);
+}
+
+/**
+ * fw_devlink_refresh_fwnode - Recheck the tree under this firmware node
+ * @fwnode: The fwnode under which the fwnode tree has changed
+ *
+ * This function is mainly meant to adjust the supplier/consumer dependencies
+ * after a fwnode tree overlay has occurred.
+ */
+void fw_devlink_refresh_fwnode(struct fwnode_handle *fwnode)
+{
+	struct device *dev;
+
+	/*
+	 * Find the closest ancestor fwnode that has been converted to a device
+	 * that can bind to a driver (bus device).
+	 */
+	fwnode_handle_get(fwnode);
+	do {
+		if (fwnode->flags & FWNODE_FLAG_NOT_DEVICE)
+			continue;
+
+		dev = get_device_from_fwnode(fwnode);
+		if (!dev)
+			continue;
+
+		if (dev->bus)
+			break;
+
+		put_device(dev);
+	} while ((fwnode = fwnode_get_next_parent(fwnode)));
+
+	/*
+	 * If none of the ancestor fwnodes have (yet) been converted to a device
+	 * that can bind to a driver, there's nothing to fix up.
+	 */
+	if (!fwnode)
+		return;
+
+	WARN(device_is_bound(dev) && dev->links.status != DL_DEV_DRIVER_BOUND,
+	     "Don't multithread overlaying and probing the same device!\n");
+
+	/*
+	 * If the device has already bound to a driver, then we need to redo
+	 * some of the work that was done after the device was bound to a
+	 * driver. If the device hasn't bound to a driver, running thing too
+	 * soon would incorrectly pick up consumers that it shouldn't.
+	 */
+	if (dev->links.status == DL_DEV_DRIVER_BOUND) {
+		fw_devlink_pickup_dangling_consumers(dev);
+		/*
+		 * Some of dangling consumers could have been put previously in
+		 * the deferred probe list due to the unavailability of their
+		 * suppliers. Those consumers have been picked up and some of
+		 * their suppliers links have been update. Time to re-try their
+		 * probe sequence.
+		 */
+		driver_deferred_probe_trigger();
+	}
+
+	put_device(dev);
+	fwnode_handle_put(fwnode);
+}
+
 static DEFINE_MUTEX(device_links_lock);
 DEFINE_STATIC_SRCU(device_links_srcu);
 
@@ -1312,16 +1385,8 @@ void device_links_driver_bound(struct device *dev)
 	 * child firmware node.
 	 */
 	if (dev->fwnode && dev->fwnode->dev == dev) {
-		struct fwnode_handle *child;
-
 		fwnode_links_purge_suppliers(dev->fwnode);
-
-		guard(mutex)(&fwnode_link_lock);
-
-		fwnode_for_each_available_child_node(dev->fwnode, child)
-			__fw_devlink_pickup_dangling_consumers(child,
-							       dev->fwnode);
-		__fw_devlink_link_to_consumers(dev);
+		fw_devlink_pickup_dangling_consumers(dev);
 	}
 	device_remove_file(dev, &dev_attr_waiting_for_supplier);
 
diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c
index c1c5686fc7b1..4e45f3414c2c 100644
--- a/drivers/of/overlay.c
+++ b/drivers/of/overlay.c
@@ -185,6 +185,15 @@ static int overlay_notify(struct overlay_changeset *ovcs,
 	return 0;
 }
 
+static void overlay_fw_devlink_refresh(struct overlay_changeset *ovcs)
+{
+	for (int i = 0; i < ovcs->count; i++) {
+		struct device_node *np = ovcs->fragments[i].target;
+
+		fw_devlink_refresh_fwnode(of_fwnode_handle(np));
+	}
+}
+
 /*
  * The values of properties in the "/__symbols__" node are paths in
  * the ovcs->overlay_root.  When duplicating the properties, the paths
@@ -951,6 +960,12 @@ static int of_overlay_apply(struct overlay_changeset *ovcs,
 		pr_err("overlay apply changeset entry notify error %d\n", ret);
 	/* notify failure is not fatal, continue */
 
+	/*
+	 * Needs to happen after changeset notify to give the listeners a chance
+	 * to finish creating all the devices they need to create.
+	 */
+	overlay_fw_devlink_refresh(ovcs);
+
 	ret_tmp = overlay_notify(ovcs, OF_OVERLAY_POST_APPLY);
 	if (ret_tmp)
 		if (!ret)
diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h
index 097be89487bf..a921ca2fe940 100644
--- a/include/linux/fwnode.h
+++ b/include/linux/fwnode.h
@@ -228,6 +228,7 @@ int fwnode_link_add(struct fwnode_handle *con, struct fwnode_handle *sup,
 		    u8 flags);
 void fwnode_links_purge(struct fwnode_handle *fwnode);
 void fw_devlink_purge_absent_suppliers(struct fwnode_handle *fwnode);
+void fw_devlink_refresh_fwnode(struct fwnode_handle *fwnode);
 bool fw_devlink_is_strict(void);
 
 #endif
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v5 04/28] driver core: Avoid warning when removing a device while its supplier is unbinding
  2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
                   ` (2 preceding siblings ...)
  2026-02-27 13:54 ` [PATCH v5 03/28] of: dynamic: Fix overlayed devices not probing because of fw_devlink Herve Codina
@ 2026-02-27 13:54 ` Herve Codina
  2026-02-27 13:54 ` [PATCH v5 05/28] bus: simple-pm-bus: Remove child devices when the bus is unbound Herve Codina
                   ` (23 subsequent siblings)
  27 siblings, 0 replies; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, Steen Hegelund, Luca Ceresoli,
	Thomas Petazzoni, Saravana Kannan

During driver removal, the following warning can appear:
   WARNING: CPU: 1 PID: 139 at drivers/base/core.c:1497 __device_links_no_driver+0xcc/0xfc
   ...
   Call trace:
     __device_links_no_driver+0xcc/0xfc (P)
     device_links_driver_cleanup+0xa8/0xf0
     device_release_driver_internal+0x208/0x23c
     device_links_unbind_consumers+0xe0/0x108
     device_release_driver_internal+0xec/0x23c
     device_links_unbind_consumers+0xe0/0x108
     device_release_driver_internal+0xec/0x23c
     device_links_unbind_consumers+0xe0/0x108
     device_release_driver_internal+0xec/0x23c
     driver_detach+0xa0/0x12c
     bus_remove_driver+0x6c/0xbc
     driver_unregister+0x30/0x60
     pci_unregister_driver+0x20/0x9c
     lan966x_pci_driver_exit+0x18/0xa90 [lan966x_pci]

This warning is triggered when a consumer is removed because the links
status of its supplier is not DL_DEV_DRIVER_BOUND and the link flag
DL_FLAG_SYNC_STATE_ONLY is not set.

The topology in terms of consumers/suppliers used was the following
(consumer ---> supplier):

      i2c -----------> OIC ----> PCI device
       |                ^
       |                |
       +---> pinctrl ---+

When the PCI device is removed, the OIC (interrupt controller) has to be
removed. In order to remove the OIC, pinctrl and i2c need to be removed
and to remove pinctrl, i2c need to be removed. The removal order is:
  1) i2c
  2) pinctrl
  3) OIC
  4) PCI device

In details, the removal sequence is the following (with 0000:01:00.0 the
PCI device):
  driver_detach: call device_release_driver_internal(0000:01:00.0)...
    device_links_busy(0000:01:00.0):
      links->status = DL_DEV_UNBINDING
    device_links_unbind_consumers(0000:01:00.0):
      0000:01:00.0--oic link->status = DL_STATE_SUPPLIER_UNBIND
      call device_release_driver_internal(oic)...
        device_links_busy(oic):
          links->status = DL_DEV_UNBINDING
        device_links_unbind_consumers(oic):
          oic--pinctrl link->status = DL_STATE_SUPPLIER_UNBIND
          call device_release_driver_internal(pinctrl)...
            device_links_busy(pinctrl):
              links->status = DL_DEV_UNBINDING
            device_links_unbind_consumers(pinctrl):
              pinctrl--i2c link->status = DL_STATE_SUPPLIER_UNBIND
              call device_release_driver_internal(i2c)...
                device_links_busy(i2c): links->status = DL_DEV_UNBINDING
                __device_links_no_driver(i2c)...
                  pinctrl--i2c link->status is DL_STATE_SUPPLIER_UNBIND
                  oic--i2c link->status is DL_STATE_ACTIVE
                  oic--i2c link->supplier->links.status is DL_DEV_UNBINDING

The warning is triggered by the i2c removal because the OIC (supplier)
links status is not DL_DEV_DRIVER_BOUND. Its links status is indeed set
to DL_DEV_UNBINDING.

It is perfectly legit to have the links status set to DL_DEV_UNBINDING
in that case. Indeed we had started to unbind the OIC which triggered
the consumer unbinding and didn't finish yet when the i2c is unbound.

Avoid the warning when the supplier links status is set to
DL_DEV_UNBINDING and thus support this removal sequence without any
warnings.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Rafael J. Wysocki <rafael@kernel.org>
Reviewed-by: Saravana Kannan <saravanak@google.com>
---
 drivers/base/core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index 726e4af9b1a6..a290bc8d2845 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1500,7 +1500,8 @@ static void __device_links_no_driver(struct device *dev)
 		if (link->supplier->links.status == DL_DEV_DRIVER_BOUND) {
 			WRITE_ONCE(link->status, DL_STATE_AVAILABLE);
 		} else {
-			WARN_ON(!device_link_test(link, DL_FLAG_SYNC_STATE_ONLY));
+			WARN_ON(link->supplier->links.status != DL_DEV_UNBINDING &&
+				!device_link_test(link, DL_FLAG_SYNC_STATE_ONLY));
 			WRITE_ONCE(link->status, DL_STATE_DORMANT);
 		}
 	}
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v5 05/28] bus: simple-pm-bus: Remove child devices when the bus is unbound
  2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
                   ` (3 preceding siblings ...)
  2026-02-27 13:54 ` [PATCH v5 04/28] driver core: Avoid warning when removing a device while its supplier is unbinding Herve Codina
@ 2026-02-27 13:54 ` Herve Codina
  2026-02-27 13:54 ` [PATCH v5 06/28] bus: simple-pm-bus: Populate child nodes at probe Herve Codina
                   ` (22 subsequent siblings)
  27 siblings, 0 replies; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, Steen Hegelund, Luca Ceresoli,
	Thomas Petazzoni

During its probe, the simple-pm-bus driver (simple-pm-bus compatible
variant) populates its child devices but it doesn't touch them during
its removal.

This leads to bus child devices present and bound to drivers whereas the
bus itself is unbound.

Be consistent and remove child devices when the bus itself is unbound.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
 drivers/bus/simple-pm-bus.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/bus/simple-pm-bus.c b/drivers/bus/simple-pm-bus.c
index 3f00d953fb9a..9ebd588ea24f 100644
--- a/drivers/bus/simple-pm-bus.c
+++ b/drivers/bus/simple-pm-bus.c
@@ -83,6 +83,9 @@ static void simple_pm_bus_remove(struct platform_device *pdev)
 
 	dev_dbg(&pdev->dev, "%s\n", __func__);
 
+	if (pdev->dev.of_node)
+		of_platform_depopulate(&pdev->dev);
+
 	pm_runtime_disable(&pdev->dev);
 }
 
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v5 06/28] bus: simple-pm-bus: Populate child nodes at probe
  2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
                   ` (4 preceding siblings ...)
  2026-02-27 13:54 ` [PATCH v5 05/28] bus: simple-pm-bus: Remove child devices when the bus is unbound Herve Codina
@ 2026-02-27 13:54 ` Herve Codina
  2026-02-27 13:54 ` [PATCH v5 07/28] driver core: fw_devlink: Introduce fw_devlink_set_device() Herve Codina
                   ` (21 subsequent siblings)
  27 siblings, 0 replies; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, Steen Hegelund, Luca Ceresoli,
	Thomas Petazzoni

The simple-pm-bus driver handles several simple busses. When it is used
with busses other than a compatible "simple-pm-bus", it doesn't populate
its child devices during its probe.

This confuses fw_devlink and results in wrong or missing devlinks.

Once a driver is bound to a device and the probe() has been called,
device_links_driver_bound() is called.

This function performs operation based on the following assumption:
    If a child firmware node of the bound device is not added as a
    device, it will never be added.

Among operations done on fw_devlinks of those "never be added" devices,
device_links_driver_bound() changes their supplier.

With devices attached to a simple-bus compatible device, this change
leads to wrong devlinks where supplier of devices points to the device
parent (i.e. simple-bus compatible device) instead of the device itself
(i.e. simple-bus child).

When the device attached to the simple-bus is removed, because devlinks
are not correct, its consumers are not removed first.

In order to have correct devlinks created, make the simple-pm-bus driver
compliant with the devlink assumption and create its child devices
during its probe.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
 drivers/bus/simple-pm-bus.c | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/drivers/bus/simple-pm-bus.c b/drivers/bus/simple-pm-bus.c
index 9ebd588ea24f..30628958c923 100644
--- a/drivers/bus/simple-pm-bus.c
+++ b/drivers/bus/simple-pm-bus.c
@@ -42,14 +42,15 @@ static int simple_pm_bus_probe(struct platform_device *pdev)
 	match = of_match_device(dev->driver->of_match_table, dev);
 	/*
 	 * These are transparent bus devices (not simple-pm-bus matches) that
-	 * have their child nodes populated automatically.  So, don't need to
-	 * do anything more. We only match with the device if this driver is
-	 * the most specific match because we don't want to incorrectly bind to
-	 * a device that has a more specific driver.
+	 * need to have their child nodes populated. So, don't need to do
+	 * anything more except populate child nodes during this probe(). We
+	 * only match with the device if this driver is the most specific match
+	 * because we don't want to incorrectly bind to a device that has a more
+	 * specific driver.
 	 */
 	if (match && match->data) {
 		if (of_property_match_string(np, "compatible", match->compatible) == 0)
-			return 0;
+			goto populate;
 		else
 			return -ENODEV;
 	}
@@ -64,13 +65,14 @@ static int simple_pm_bus_probe(struct platform_device *pdev)
 
 	dev_set_drvdata(&pdev->dev, bus);
 
-	dev_dbg(&pdev->dev, "%s\n", __func__);
-
 	pm_runtime_enable(&pdev->dev);
 
+populate:
 	if (np)
 		of_platform_populate(np, NULL, lookup, &pdev->dev);
 
+	dev_dbg(&pdev->dev, "%s\n", __func__);
+
 	return 0;
 }
 
@@ -78,7 +80,7 @@ static void simple_pm_bus_remove(struct platform_device *pdev)
 {
 	const void *data = of_device_get_match_data(&pdev->dev);
 
-	if (pdev->driver_override || data)
+	if (pdev->driver_override)
 		return;
 
 	dev_dbg(&pdev->dev, "%s\n", __func__);
@@ -86,7 +88,8 @@ static void simple_pm_bus_remove(struct platform_device *pdev)
 	if (pdev->dev.of_node)
 		of_platform_depopulate(&pdev->dev);
 
-	pm_runtime_disable(&pdev->dev);
+	if (!data)
+		pm_runtime_disable(&pdev->dev);
 }
 
 static int simple_pm_bus_runtime_suspend(struct device *dev)
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v5 07/28] driver core: fw_devlink: Introduce fw_devlink_set_device()
  2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
                   ` (5 preceding siblings ...)
  2026-02-27 13:54 ` [PATCH v5 06/28] bus: simple-pm-bus: Populate child nodes at probe Herve Codina
@ 2026-02-27 13:54 ` Herve Codina
  2026-02-27 15:57   ` Charles Keepax
  2026-03-02 12:23   ` Jonathan Cameron
  2026-02-27 13:54 ` [PATCH v5 08/28] drivers: core: Use fw_devlink_set_device() Herve Codina
                   ` (20 subsequent siblings)
  27 siblings, 2 replies; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, Steen Hegelund, Luca Ceresoli,
	Thomas Petazzoni

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.

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>
---
 include/linux/fwnode.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h
index a921ca2fe940..a1345e274125 100644
--- a/include/linux/fwnode.h
+++ b/include/linux/fwnode.h
@@ -231,4 +231,10 @@ void fw_devlink_purge_absent_suppliers(struct fwnode_handle *fwnode);
 void fw_devlink_refresh_fwnode(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.53.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v5 08/28] drivers: core: Use fw_devlink_set_device()
  2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
                   ` (6 preceding siblings ...)
  2026-02-27 13:54 ` [PATCH v5 07/28] driver core: fw_devlink: Introduce fw_devlink_set_device() Herve Codina
@ 2026-02-27 13:54 ` Herve Codina
  2026-02-27 13:54 ` [PATCH v5 09/28] pinctrl: cs42l43: " Herve Codina
                   ` (19 subsequent siblings)
  27 siblings, 0 replies; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, 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: 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 a290bc8d2845..3f3a909306d2 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -3748,7 +3748,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);
 	}
 
@@ -3908,7 +3908,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.53.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v5 09/28] pinctrl: cs42l43: Use fw_devlink_set_device()
  2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
                   ` (7 preceding siblings ...)
  2026-02-27 13:54 ` [PATCH v5 08/28] drivers: core: Use fw_devlink_set_device() Herve Codina
@ 2026-02-27 13:54 ` Herve Codina
  2026-02-27 14:11   ` Linus Walleij
  2026-02-27 15:58   ` Charles Keepax
  2026-02-27 13:54 ` [PATCH v5 10/28] cxl/test: Use device_set_node() Herve Codina
                   ` (18 subsequent siblings)
  27 siblings, 2 replies; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, 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>
---
 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 a8f82104a384..a3dd8da15919 100644
--- a/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
+++ b/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
@@ -579,7 +579,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.53.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v5 10/28] cxl/test: Use device_set_node()
  2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
                   ` (8 preceding siblings ...)
  2026-02-27 13:54 ` [PATCH v5 09/28] pinctrl: cs42l43: " Herve Codina
@ 2026-02-27 13:54 ` Herve Codina
  2026-03-02 12:21   ` Jonathan Cameron
  2026-02-27 13:54 ` [PATCH v5 11/28] cxl/test: Use fw_devlink_set_device() Herve Codina
                   ` (17 subsequent siblings)
  27 siblings, 1 reply; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, Steen Hegelund, Luca Ceresoli,
	Thomas Petazzoni

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>
---
 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 81e2aef3627a..3d9107b2661c 100644
--- a/tools/testing/cxl/test/cxl.c
+++ b/tools/testing/cxl/test/cxl.c
@@ -1136,7 +1136,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.53.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v5 11/28] cxl/test: Use fw_devlink_set_device()
  2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
                   ` (9 preceding siblings ...)
  2026-02-27 13:54 ` [PATCH v5 10/28] cxl/test: Use device_set_node() Herve Codina
@ 2026-02-27 13:54 ` Herve Codina
  2026-03-02 12:24   ` Jonathan Cameron
  2026-02-27 13:54 ` [PATCH v5 12/28] PCI: of: " Herve Codina
                   ` (16 subsequent siblings)
  27 siblings, 1 reply; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, 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: Dave Jiang <dave.jiang@intel.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 3d9107b2661c..7f232a869389 100644
--- a/tools/testing/cxl/test/cxl.c
+++ b/tools/testing/cxl/test/cxl.c
@@ -1137,7 +1137,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.53.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v5 12/28] PCI: of: Use fw_devlink_set_device()
  2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
                   ` (10 preceding siblings ...)
  2026-02-27 13:54 ` [PATCH v5 11/28] cxl/test: Use fw_devlink_set_device() Herve Codina
@ 2026-02-27 13:54 ` Herve Codina
  2026-02-27 13:54 ` [PATCH v5 13/28] PCI: of: Set fwnode device of newly created PCI device nodes Herve Codina
                   ` (15 subsequent siblings)
  27 siblings, 0 replies; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, 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>
---
 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 9f8eb5df279e..5fb7f501fd35 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.53.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v5 13/28] PCI: of: Set fwnode device of newly created PCI device nodes
  2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
                   ` (11 preceding siblings ...)
  2026-02-27 13:54 ` [PATCH v5 12/28] PCI: of: " Herve Codina
@ 2026-02-27 13:54 ` Herve Codina
  2026-02-27 13:54 ` [PATCH v5 14/28] PCI: of: Remove fwnode_dev_initialized() call for a PCI root bridge node Herve Codina
                   ` (14 subsequent siblings)
  27 siblings, 0 replies; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, Steen Hegelund, Luca Ceresoli,
	Thomas Petazzoni

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 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.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
 drivers/pci/of.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/pci/of.c b/drivers/pci/of.c
index 5fb7f501fd35..b694fcda16b1 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.53.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v5 14/28] PCI: of: Remove fwnode_dev_initialized() call for a PCI root bridge node
  2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
                   ` (12 preceding siblings ...)
  2026-02-27 13:54 ` [PATCH v5 13/28] PCI: of: Set fwnode device of newly created PCI device nodes Herve Codina
@ 2026-02-27 13:54 ` Herve Codina
  2026-02-27 13:54 ` [PATCH v5 15/28] i2c: core: Introduce i2c_get_adapter_physdev() Herve Codina
                   ` (13 subsequent siblings)
  27 siblings, 0 replies; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, Steen Hegelund, Luca Ceresoli,
	Thomas Petazzoni

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@bootlin.com>
---
 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


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v5 15/28] i2c: core: Introduce i2c_get_adapter_physdev()
  2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
                   ` (13 preceding siblings ...)
  2026-02-27 13:54 ` [PATCH v5 14/28] PCI: of: Remove fwnode_dev_initialized() call for a PCI root bridge node Herve Codina
@ 2026-02-27 13:54 ` Herve Codina
  2026-02-27 13:54 ` [PATCH v5 16/28] i2c: mux: Set adapter physical device Herve Codina
                   ` (12 subsequent siblings)
  27 siblings, 0 replies; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, Steen Hegelund, Luca Ceresoli,
	Thomas Petazzoni

The physical device providing an I2C adapter is the device that calls
i2c_add_adapter() or variants and i2c_del_adapter().

Most of the time this physical device is the parent of the adapter
device.

Exceptions exist with i2c muxes. Indeed, in case of i2c muxes, the
parent of the mux adapter device points to the adapter device the mux is
connected to instead of the physical of this mux adapter.

Introduce i2c_get_adapter_physdev() and a new physdev field in the
adapter structure in order to ease the adapter physical device
retrieval.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
---
 drivers/i2c/i2c-core-base.c | 16 ++++++++++++++++
 include/linux/i2c.h         |  3 +++
 2 files changed, 19 insertions(+)

diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index 9c46147e3506..59214f0c84ec 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -1919,6 +1919,22 @@ struct i2c_adapter *i2c_get_adapter_by_fwnode(struct fwnode_handle *fwnode)
 }
 EXPORT_SYMBOL(i2c_get_adapter_by_fwnode);
 
+/**
+ * i2c_get_adapter_physdev() - Get the physical device of an adapter
+ * @adapter: the adapter to get the physical device from
+ *
+ * Return:
+ * Look up and return the &struct device corresponding to the device supplying
+ * this @adapter.
+ *
+ * The user must call put_device() once done with the physical device returned.
+ */
+struct device *i2c_get_adapter_physdev(struct i2c_adapter *adapter)
+{
+	return get_device(adapter->physdev ?: adapter->dev.parent);
+}
+EXPORT_SYMBOL(i2c_get_adapter_physdev);
+
 static void i2c_parse_timing(struct device *dev, char *prop_name, u32 *cur_val_p,
 			    u32 def_val, bool use_def)
 {
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 20fd41b51d5c..dff04d20cafe 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -744,6 +744,7 @@ struct i2c_adapter {
 	int timeout;			/* in jiffies */
 	int retries;
 	struct device dev;		/* the adapter device */
+	struct device *physdev;		/* the physical device */
 	unsigned long locked_flags;	/* owned by the I2C core */
 #define I2C_ALF_IS_SUSPENDED		0
 #define I2C_ALF_SUSPEND_REPORTED	1
@@ -911,6 +912,8 @@ struct i2c_adapter *i2c_get_adapter(int nr);
 void i2c_put_adapter(struct i2c_adapter *adap);
 unsigned int i2c_adapter_depth(struct i2c_adapter *adapter);
 
+struct device *i2c_get_adapter_physdev(struct i2c_adapter *adap);
+
 void i2c_parse_fw_timings(struct device *dev, struct i2c_timings *t, bool use_defaults);
 
 /* Return the functionality mask */
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v5 16/28] i2c: mux: Set adapter physical device
  2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
                   ` (14 preceding siblings ...)
  2026-02-27 13:54 ` [PATCH v5 15/28] i2c: core: Introduce i2c_get_adapter_physdev() Herve Codina
@ 2026-02-27 13:54 ` Herve Codina
  2026-02-27 13:54 ` [PATCH v5 17/28] i2c: mux: Create missing devlink between mux and " Herve Codina
                   ` (11 subsequent siblings)
  27 siblings, 0 replies; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, Steen Hegelund, Luca Ceresoli,
	Thomas Petazzoni

For i2c muxes, the parent of the mux adapter device is the adapter
device the mux is connected to.

This parent is not the physical device related to the mux adapter.
Indeed, the physical device of the mux adapter is the mux device itself.

Fill the adap.physdev with the mux device.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
---
 drivers/i2c/i2c-mux.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c
index 681a201c239b..f4e73e7a0e33 100644
--- a/drivers/i2c/i2c-mux.c
+++ b/drivers/i2c/i2c-mux.c
@@ -315,6 +315,7 @@ int i2c_mux_add_adapter(struct i2c_mux_core *muxc,
 	priv->adap.algo = &priv->algo;
 	priv->adap.algo_data = priv;
 	priv->adap.dev.parent = &parent->dev;
+	priv->adap.physdev = muxc->dev;
 	priv->adap.retries = parent->retries;
 	priv->adap.timeout = parent->timeout;
 	priv->adap.quirks = parent->quirks;
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v5 17/28] i2c: mux: Create missing devlink between mux and adapter physical device
  2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
                   ` (15 preceding siblings ...)
  2026-02-27 13:54 ` [PATCH v5 16/28] i2c: mux: Set adapter physical device Herve Codina
@ 2026-02-27 13:54 ` Herve Codina
  2026-02-27 13:54 ` [PATCH v5 18/28] of: property: Allow fw_devlink device-tree on x86 Herve Codina
                   ` (10 subsequent siblings)
  27 siblings, 0 replies; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, Steen Hegelund, Luca Ceresoli,
	Thomas Petazzoni

When removing an i2c controller device handling an i2c bus where an i2c
mux is connected to, the removal process hangs and is stuck in the
wait_completion() call done in i2c_del_adapter().

The i2c_del_adapter() tries to removed the i2c adapter related to the
i2c controller device and the wait_completion() is waiting for the i2c
adapter device release. This release is performed when the device is no
more used (i.e. refcount reaches zero).

When an i2c mux is involved in an i2c path, the struct dev topology is
the following:

    +----------------+                +-------------------+
    | i2c controller |                |      i2c mux      |
    |     device     |                |      device       |
    |       ^        |                |                   |
    |       |        |                |                   |
    |  dev's parent  |                |                   |
    |       |        |                |                   |
    |   i2c adapter  |                | i2c adapter chanX |
    |     device  <---- dev's parent ------  device       |
    |   (no driver)  |                |    (no driver)    |
    +----------------+                +-------------------+

When an i2c mux device creates an i2c adapter for its downstream
channel, a reference is taken to its adapter dev's parent. This parent
is the i2c mux upstream adapter device.

No relationship exists between the i2c mux device itself and the i2c
controller device (physical device) in order to have the i2c mux device
calling i2c_del_adapter() to remove its downstream adapters and so,
release references taken to the upstream adapter.

This consumer/supplier relationship is typically a devlink relationship.

Also, i2c muxes can be chained and so, the upstream adapter can be
supplied by either an i2c controller device or an other i2c mux device.

In order to get the physical device of the adapter a mux is connected
to, rely on the newly introduced i2c_adapter_get_physdev() and create
the missing devlink between the i2c mux device and the physical
device of the adapter the mux is connected to.

With that done, the i2c mux device is removed before the device
handling the upstream i2c adapter (i2c controller device or i2c mux
device). All references are released and the i2c_del_adapter() call
performed by driver handling the upstream adapter device is not blocking
anymore.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
 drivers/i2c/i2c-mux.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c
index f4e73e7a0e33..26470a7c2eea 100644
--- a/drivers/i2c/i2c-mux.c
+++ b/drivers/i2c/i2c-mux.c
@@ -268,7 +268,9 @@ int i2c_mux_add_adapter(struct i2c_mux_core *muxc,
 			u32 force_nr, u32 chan_id)
 {
 	struct i2c_adapter *parent = muxc->parent;
+	struct device *parent_physdev;
 	struct i2c_mux_priv *priv;
+	struct device_link *dl;
 	char symlink_name[20];
 	int ret;
 
@@ -375,6 +377,29 @@ int i2c_mux_add_adapter(struct i2c_mux_core *muxc,
 				      ACPI_COMPANION(muxc->dev),
 				      chan_id);
 
+	/*
+	 * There is no relationship set between the mux device and the physical
+	 * device handling the parent adapter. Create this missing relationship
+	 * in order to remove the i2c mux device (consumer) and so the dowstream
+	 * channel adapters before removing the physical device (supplier) which
+	 * handles the i2c mux upstream adapter.
+	 */
+	parent_physdev = i2c_get_adapter_physdev(parent);
+	if (!parent_physdev) {
+		dev_err(muxc->dev, "failed to get the parent physical device\n");
+		ret = -ENODEV;
+		goto err_free_priv;
+	}
+	dl = device_link_add(muxc->dev, parent_physdev, DL_FLAG_AUTOREMOVE_CONSUMER);
+	if (!dl) {
+		dev_err(muxc->dev, "failed to create device link to %s\n",
+			dev_name(parent_physdev));
+		put_device(parent_physdev);
+		ret = -EINVAL;
+		goto err_free_priv;
+	}
+	put_device(parent_physdev);
+
 	if (force_nr) {
 		priv->adap.nr = force_nr;
 		ret = i2c_add_numbered_adapter(&priv->adap);
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v5 18/28] of: property: Allow fw_devlink device-tree on x86
  2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
                   ` (16 preceding siblings ...)
  2026-02-27 13:54 ` [PATCH v5 17/28] i2c: mux: Create missing devlink between mux and " Herve Codina
@ 2026-02-27 13:54 ` Herve Codina
  2026-02-27 13:54 ` [PATCH v5 19/28] clk: lan966x: Add MCHP_LAN966X_PCI dependency Herve Codina
                   ` (9 subsequent siblings)
  27 siblings, 0 replies; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, Steen Hegelund, Luca Ceresoli,
	Thomas Petazzoni

PCI drivers can use a device-tree overlay to describe the hardware
available on the PCI board. This is the case, for instance, of the
LAN966x PCI device driver.

Adding some more nodes in the device-tree overlay adds some more
consumer/supplier relationship between devices instantiated from this
overlay.

Those fw_node consumer/supplier relationships are handled by fw_devlink
and are created based on the device-tree parsing done by the
of_fwnode_add_links() function.

Those consumer/supplier links are needed in order to ensure a correct PM
runtime management and a correct removal order between devices.

For instance, without those links a supplier can be removed before its
consumers is removed leading to all kind of issue if this consumer still
want the use the already removed supplier.

The support for the usage of an overlay from a PCI driver has been added
on x86 systems in commit 1f340724419ed ("PCI: of: Create device tree PCI
host bridge node").

In the past, support for fw_devlink on x86 had been tried but this
support has been removed in commit 4a48b66b3f52 ("of: property: Disable
fw_devlink DT support for X86"). Indeed, this support was breaking some
x86 systems such as OLPC system and the regression was reported in [0].

Instead of disabling this support for all x86 system, use a finer grain
and disable this support only for the possible problematic subset of x86
systems (at least OLPC and CE4100).

Those systems use a device-tree to describe their hardware. Identify
those systems using key properties in the device-tree.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://lore.kernel.org/lkml/3c1f2473-92ad-bfc4-258e-a5a08ad73dd0@web.de/ [0]
---
 drivers/of/property.c | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/drivers/of/property.c b/drivers/of/property.c
index 50d95d512bf5..80800a20d1ac 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -1620,12 +1620,36 @@ static int of_fwnode_irq_get(const struct fwnode_handle *fwnode,
 	return of_irq_get(to_of_node(fwnode), index);
 }
 
+static int match_property_by_path(const char *node_path, const char *prop_name,
+				  const char *value)
+{
+	struct device_node *np __free(device_node) = of_find_node_by_path(node_path);
+
+	return of_property_match_string(np, prop_name, value);
+}
+
+static bool of_is_fwnode_add_links_supported(void)
+{
+	static int is_supported = -1;
+
+	if (!IS_ENABLED(CONFIG_X86))
+		return true;
+
+	if (is_supported != -1)
+		return !!is_supported;
+
+	is_supported = !((match_property_by_path("/soc", "compatible", "intel,ce4100-cp") >= 0) ||
+			 (match_property_by_path("/", "architecture", "OLPC") >= 0));
+
+	return !!is_supported;
+}
+
 static int of_fwnode_add_links(struct fwnode_handle *fwnode)
 {
 	const struct property *p;
 	struct device_node *con_np = to_of_node(fwnode);
 
-	if (IS_ENABLED(CONFIG_X86))
+	if (!of_is_fwnode_add_links_supported())
 		return 0;
 
 	if (!con_np)
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v5 19/28] clk: lan966x: Add MCHP_LAN966X_PCI dependency
  2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
                   ` (17 preceding siblings ...)
  2026-02-27 13:54 ` [PATCH v5 18/28] of: property: Allow fw_devlink device-tree on x86 Herve Codina
@ 2026-02-27 13:54 ` Herve Codina
  2026-02-27 13:54 ` [PATCH v5 20/28] i2c: busses: at91: " Herve Codina
                   ` (8 subsequent siblings)
  27 siblings, 0 replies; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, Steen Hegelund, Luca Ceresoli,
	Thomas Petazzoni

The lan966x clock controller depends on the LAN969x architecture or the
LAN966x SoC.

This clock controller can be used by the LAN966x PCI device and so it
needs to be available when the LAN966x PCI device is enabled.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Acked-by: Stephen Boyd <sboyd@kernel.org>
---
 drivers/clk/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
index 3d803b4cf5c1..0231dd449134 100644
--- a/drivers/clk/Kconfig
+++ b/drivers/clk/Kconfig
@@ -278,7 +278,7 @@ config COMMON_CLK_LAN966X
 	tristate "Generic Clock Controller driver for LAN966X SoC"
 	depends on HAS_IOMEM
 	depends on OF
-	depends on SOC_LAN966 || ARCH_LAN969X || COMPILE_TEST
+	depends on SOC_LAN966 || ARCH_LAN969X || MCHP_LAN966X_PCI || COMPILE_TEST
 	help
 	  This driver provides support for Generic Clock Controller(GCK) on
 	  LAN966X SoC. GCK generates and supplies clock to various peripherals
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v5 20/28] i2c: busses: at91: Add MCHP_LAN966X_PCI dependency
  2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
                   ` (18 preceding siblings ...)
  2026-02-27 13:54 ` [PATCH v5 19/28] clk: lan966x: Add MCHP_LAN966X_PCI dependency Herve Codina
@ 2026-02-27 13:54 ` Herve Codina
  2026-02-27 13:54 ` [PATCH v5 21/28] misc: lan966x_pci: Fix dtso nodes ordering Herve Codina
                   ` (7 subsequent siblings)
  27 siblings, 0 replies; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, Steen Hegelund, Luca Ceresoli,
	Thomas Petazzoni

The AT91 I2C driver depends on ARCH_MICROCHIP.

This I2C controller can be used by the LAN966x PCI device and so
it needs to be available when the LAN966x PCI device is enabled.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Acked-by: Andi Shyti <andi.shyti@kernel.org>
---
 drivers/i2c/busses/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index e11d50750e63..f43b3e8ca317 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -417,7 +417,7 @@ config I2C_ASPEED
 
 config I2C_AT91
 	tristate "Atmel AT91 I2C Two-Wire interface (TWI)"
-	depends on ARCH_MICROCHIP || COMPILE_TEST
+	depends on ARCH_MICROCHIP || MCHP_LAN966X_PCI || COMPILE_TEST
 	help
 	  This supports the use of the I2C interface on Atmel AT91
 	  processors.
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v5 21/28] misc: lan966x_pci: Fix dtso nodes ordering
  2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
                   ` (19 preceding siblings ...)
  2026-02-27 13:54 ` [PATCH v5 20/28] i2c: busses: at91: " Herve Codina
@ 2026-02-27 13:54 ` Herve Codina
  2026-02-27 13:54 ` [PATCH v5 22/28] misc: lan966x_pci: Split dtso in dtsi/dtso Herve Codina
                   ` (6 subsequent siblings)
  27 siblings, 0 replies; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, Steen Hegelund, Luca Ceresoli,
	Thomas Petazzoni

Nodes available in the dtso are not ordered by their unit address.

Fix that re-ordering them according to their unit address.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
 drivers/misc/lan966x_pci.dtso | 99 +++++++++++++++++------------------
 1 file changed, 49 insertions(+), 50 deletions(-)

diff --git a/drivers/misc/lan966x_pci.dtso b/drivers/misc/lan966x_pci.dtso
index 7b196b0a0eb6..94a967b384f3 100644
--- a/drivers/misc/lan966x_pci.dtso
+++ b/drivers/misc/lan966x_pci.dtso
@@ -59,6 +59,50 @@ pci-ep-bus@0 {
 				ranges = <0xe2000000 0x00 0x00 0x00 0x2000000
 				          0xe0000000 0x01 0x00 0x00 0x1000000>;
 
+				switch: switch@e0000000 {
+					compatible = "microchip,lan966x-switch";
+					reg = <0xe0000000 0x0100000>,
+					      <0xe2000000 0x0800000>;
+					reg-names = "cpu", "gcb";
+
+					interrupt-parent = <&oic>;
+					interrupts = <12 IRQ_TYPE_LEVEL_HIGH>,
+						     <9 IRQ_TYPE_LEVEL_HIGH>;
+					interrupt-names = "xtr", "ana";
+
+					resets = <&reset 0>;
+					reset-names = "switch";
+
+					pinctrl-names = "default";
+					pinctrl-0 = <&tod_pins>;
+
+					ethernet-ports {
+						#address-cells = <1>;
+						#size-cells = <0>;
+
+						port0: port@0 {
+							phy-handle = <&lan966x_phy0>;
+
+							reg = <0>;
+							phy-mode = "gmii";
+							phys = <&serdes 0 CU(0)>;
+						};
+
+						port1: port@1 {
+							phy-handle = <&lan966x_phy1>;
+
+							reg = <1>;
+							phy-mode = "gmii";
+							phys = <&serdes 1 CU(1)>;
+						};
+					};
+				};
+
+				cpu_ctrl: syscon@e00c0000 {
+					compatible = "microchip,lan966x-cpu-syscon", "syscon";
+					reg = <0xe00c0000 0xa8>;
+				};
+
 				oic: oic@e00c0120 {
 					compatible = "microchip,lan966x-oic";
 					#interrupt-cells = <2>;
@@ -67,11 +111,6 @@ oic: oic@e00c0120 {
 					reg = <0xe00c0120 0x190>;
 				};
 
-				cpu_ctrl: syscon@e00c0000 {
-					compatible = "microchip,lan966x-cpu-syscon", "syscon";
-					reg = <0xe00c0000 0xa8>;
-				};
-
 				reset: reset@e200400c {
 					compatible = "microchip,lan966x-switch-reset";
 					reg = <0xe200400c 0x4>, <0xe00c0000 0xa8>;
@@ -104,14 +143,6 @@ fc0_a_pins: fcb4-i2c-pins {
 						pins = "GPIO_9", "GPIO_10";
 						function = "fc0_a";
 					};
-
-				};
-
-				serdes: serdes@e202c000 {
-					compatible = "microchip,lan966x-serdes";
-					reg = <0xe202c000 0x9c>,
-					      <0xe2004010 0x4>;
-					#phy-cells = <2>;
 				};
 
 				mdio1: mdio@e200413c {
@@ -133,43 +164,11 @@ lan966x_phy1: ethernet-lan966x_phy@2 {
 					};
 				};
 
-				switch: switch@e0000000 {
-					compatible = "microchip,lan966x-switch";
-					reg = <0xe0000000 0x0100000>,
-					      <0xe2000000 0x0800000>;
-					reg-names = "cpu", "gcb";
-
-					interrupt-parent = <&oic>;
-					interrupts = <12 IRQ_TYPE_LEVEL_HIGH>,
-						     <9 IRQ_TYPE_LEVEL_HIGH>;
-					interrupt-names = "xtr", "ana";
-
-					resets = <&reset 0>;
-					reset-names = "switch";
-
-					pinctrl-names = "default";
-					pinctrl-0 = <&tod_pins>;
-
-					ethernet-ports {
-						#address-cells = <1>;
-						#size-cells = <0>;
-
-						port0: port@0 {
-							phy-handle = <&lan966x_phy0>;
-
-							reg = <0>;
-							phy-mode = "gmii";
-							phys = <&serdes 0 CU(0)>;
-						};
-
-						port1: port@1 {
-							phy-handle = <&lan966x_phy1>;
-
-							reg = <1>;
-							phy-mode = "gmii";
-							phys = <&serdes 1 CU(1)>;
-						};
-					};
+				serdes: serdes@e202c000 {
+					compatible = "microchip,lan966x-serdes";
+					reg = <0xe202c000 0x9c>,
+					      <0xe2004010 0x4>;
+					#phy-cells = <2>;
 				};
 			};
 		};
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v5 22/28] misc: lan966x_pci: Split dtso in dtsi/dtso
  2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
                   ` (20 preceding siblings ...)
  2026-02-27 13:54 ` [PATCH v5 21/28] misc: lan966x_pci: Fix dtso nodes ordering Herve Codina
@ 2026-02-27 13:54 ` Herve Codina
  2026-02-27 13:54 ` [PATCH v5 23/28] misc: lan966x_pci: Rename lan966x_pci.dtso to lan966x_evb_lan9662_nic.dtso Herve Codina
                   ` (5 subsequent siblings)
  27 siblings, 0 replies; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, Steen Hegelund, Luca Ceresoli,
	Thomas Petazzoni

The lan966x_pci.dtso file contains descriptions related to both the
LAN966x PCI device chip and the LAN966x PCI device board where the chip
is soldered.

Split the file in order to have:
  - lan966x_pci.dtsi
    The description related to the PCI chip.

  - lan966x_pci.dtso
    The description of the PCI board.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
 MAINTAINERS                   |   1 +
 drivers/misc/lan966x_pci.dtsi | 130 +++++++++++++++++++++++++
 drivers/misc/lan966x_pci.dtso | 175 +++++++---------------------------
 3 files changed, 166 insertions(+), 140 deletions(-)
 create mode 100644 drivers/misc/lan966x_pci.dtsi

diff --git a/MAINTAINERS b/MAINTAINERS
index 55af015174a5..441fe74e7ef7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -17305,6 +17305,7 @@ MICROCHIP LAN966X PCI DRIVER
 M:	Herve Codina <herve.codina@bootlin.com>
 S:	Maintained
 F:	drivers/misc/lan966x_pci.c
+F:	drivers/misc/lan966x_pci.dtsi
 F:	drivers/misc/lan966x_pci.dtso
 
 MICROCHIP LAN969X ETHERNET DRIVER
diff --git a/drivers/misc/lan966x_pci.dtsi b/drivers/misc/lan966x_pci.dtsi
new file mode 100644
index 000000000000..170298084fa5
--- /dev/null
+++ b/drivers/misc/lan966x_pci.dtsi
@@ -0,0 +1,130 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2025 Microchip UNG
+ */
+
+#include <dt-bindings/interrupt-controller/irq.h>
+
+cpu_clk: clock-600000000 {
+	compatible = "fixed-clock";
+	#clock-cells = <0>;
+	clock-frequency = <600000000>;  /* CPU clock = 600MHz */
+};
+
+ddr_clk: clock-30000000 {
+	compatible = "fixed-clock";
+	#clock-cells = <0>;
+	clock-frequency = <30000000>;  /* Fabric clock = 30MHz */
+};
+
+sys_clk: clock-15625000 {
+	compatible = "fixed-clock";
+	#clock-cells = <0>;
+	clock-frequency = <15625000>;  /* System clock = 15.625MHz */
+};
+
+pci-ep-bus@0 {
+	compatible = "simple-bus";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	/*
+	 * map @0xe2000000 (32MB) to BAR0 (CPU)
+	 * map @0xe0000000 (16MB) to BAR1 (AMBA)
+	 */
+	ranges = <0xe2000000 0x00 0x00 0x00 0x2000000
+		  0xe0000000 0x01 0x00 0x00 0x1000000>;
+
+	switch: switch@e0000000 {
+		compatible = "microchip,lan966x-switch";
+		reg = <0xe0000000 0x0100000>,
+		      <0xe2000000 0x0800000>;
+		reg-names = "cpu", "gcb";
+		interrupt-parent = <&oic>;
+		interrupts = <12 IRQ_TYPE_LEVEL_HIGH>,
+			     <9 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "xtr", "ana";
+		resets = <&reset 0>;
+		reset-names = "switch";
+		status = "disabled";
+
+		ethernet-ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port0: port@0 {
+				reg = <0>;
+				status = "disabled";
+			};
+
+			port1: port@1 {
+				reg = <1>;
+				status = "disabled";
+			};
+		};
+	};
+
+	cpu_ctrl: syscon@e00c0000 {
+		compatible = "microchip,lan966x-cpu-syscon", "syscon";
+		reg = <0xe00c0000 0xa8>;
+	};
+
+	oic: oic@e00c0120 {
+		compatible = "microchip,lan966x-oic";
+		#interrupt-cells = <2>;
+		interrupt-controller;
+		interrupts = <0>; /* PCI INTx assigned interrupt */
+		reg = <0xe00c0120 0x190>;
+	};
+
+	reset: reset@e200400c {
+		compatible = "microchip,lan966x-switch-reset";
+		reg = <0xe200400c 0x4>, <0xe00c0000 0xa8>;
+		reg-names = "gcb","cpu";
+		#reset-cells = <1>;
+		cpu-syscon = <&cpu_ctrl>;
+	};
+
+	gpio: pinctrl@e2004064 {
+		compatible = "microchip,lan966x-pinctrl";
+		reg = <0xe2004064 0xb4>,
+		      <0xe2010024 0x138>;
+		resets = <&reset 0>;
+		reset-names = "switch";
+		gpio-controller;
+		#gpio-cells = <2>;
+		gpio-ranges = <&gpio 0 0 78>;
+		interrupt-parent = <&oic>;
+		interrupt-controller;
+		interrupts = <17 IRQ_TYPE_LEVEL_HIGH>;
+		#interrupt-cells = <2>;
+	};
+
+	mdio1: mdio@e200413c {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "microchip,lan966x-miim";
+		reg = <0xe200413c 0x24>,
+		      <0xe2010020 0x4>;
+		resets = <&reset 0>;
+		reset-names = "switch";
+		status = "disabled";
+
+		lan966x_phy0: ethernet-lan966x_phy@1 {
+			reg = <1>;
+			status = "disabled";
+		};
+
+		lan966x_phy1: ethernet-lan966x_phy@2 {
+			reg = <2>;
+			status = "disabled";
+		};
+	};
+
+	serdes: serdes@e202c000 {
+		compatible = "microchip,lan966x-serdes";
+		reg = <0xe202c000 0x9c>,
+		      <0xe2004010 0x4>;
+		#phy-cells = <2>;
+	};
+};
diff --git a/drivers/misc/lan966x_pci.dtso b/drivers/misc/lan966x_pci.dtso
index 94a967b384f3..3ad50abee72d 100644
--- a/drivers/misc/lan966x_pci.dtso
+++ b/drivers/misc/lan966x_pci.dtso
@@ -3,10 +3,7 @@
  * Copyright (C) 2022 Microchip UNG
  */
 
-#include <dt-bindings/clock/microchip,lan966x.h>
 #include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/interrupt-controller/irq.h>
-#include <dt-bindings/mfd/atmel-flexcom.h>
 #include <dt-bindings/phy/phy-lan966x-serdes.h>
 
 /dts-v1/;
@@ -29,148 +26,46 @@ __overlay__ {
 			#address-cells = <3>;
 			#size-cells = <2>;
 
-			cpu_clk: clock-600000000 {
-				compatible = "fixed-clock";
-				#clock-cells = <0>;
-				clock-frequency = <600000000>;  /* CPU clock = 600MHz */
-			};
-
-			ddr_clk: clock-30000000 {
-				compatible = "fixed-clock";
-				#clock-cells = <0>;
-				clock-frequency = <30000000>;  /* Fabric clock = 30MHz */
-			};
-
-			sys_clk: clock-15625000 {
-				compatible = "fixed-clock";
-				#clock-cells = <0>;
-				clock-frequency = <15625000>;  /* System clock = 15.625MHz */
-			};
-
-			pci-ep-bus@0 {
-				compatible = "simple-bus";
-				#address-cells = <1>;
-				#size-cells = <1>;
-
-				/*
-				 * map @0xe2000000 (32MB) to BAR0 (CPU)
-				 * map @0xe0000000 (16MB) to BAR1 (AMBA)
-				 */
-				ranges = <0xe2000000 0x00 0x00 0x00 0x2000000
-				          0xe0000000 0x01 0x00 0x00 0x1000000>;
-
-				switch: switch@e0000000 {
-					compatible = "microchip,lan966x-switch";
-					reg = <0xe0000000 0x0100000>,
-					      <0xe2000000 0x0800000>;
-					reg-names = "cpu", "gcb";
-
-					interrupt-parent = <&oic>;
-					interrupts = <12 IRQ_TYPE_LEVEL_HIGH>,
-						     <9 IRQ_TYPE_LEVEL_HIGH>;
-					interrupt-names = "xtr", "ana";
-
-					resets = <&reset 0>;
-					reset-names = "switch";
-
-					pinctrl-names = "default";
-					pinctrl-0 = <&tod_pins>;
-
-					ethernet-ports {
-						#address-cells = <1>;
-						#size-cells = <0>;
-
-						port0: port@0 {
-							phy-handle = <&lan966x_phy0>;
-
-							reg = <0>;
-							phy-mode = "gmii";
-							phys = <&serdes 0 CU(0)>;
-						};
-
-						port1: port@1 {
-							phy-handle = <&lan966x_phy1>;
-
-							reg = <1>;
-							phy-mode = "gmii";
-							phys = <&serdes 1 CU(1)>;
-						};
-					};
-				};
-
-				cpu_ctrl: syscon@e00c0000 {
-					compatible = "microchip,lan966x-cpu-syscon", "syscon";
-					reg = <0xe00c0000 0xa8>;
-				};
-
-				oic: oic@e00c0120 {
-					compatible = "microchip,lan966x-oic";
-					#interrupt-cells = <2>;
-					interrupt-controller;
-					interrupts = <0>; /* PCI INTx assigned interrupt */
-					reg = <0xe00c0120 0x190>;
-				};
-
-				reset: reset@e200400c {
-					compatible = "microchip,lan966x-switch-reset";
-					reg = <0xe200400c 0x4>, <0xe00c0000 0xa8>;
-					reg-names = "gcb","cpu";
-					#reset-cells = <1>;
-					cpu-syscon = <&cpu_ctrl>;
-				};
-
-				gpio: pinctrl@e2004064 {
-					compatible = "microchip,lan966x-pinctrl";
-					reg = <0xe2004064 0xb4>,
-					      <0xe2010024 0x138>;
-					resets = <&reset 0>;
-					reset-names = "switch";
-					gpio-controller;
-					#gpio-cells = <2>;
-					gpio-ranges = <&gpio 0 0 78>;
-					interrupt-parent = <&oic>;
-					interrupt-controller;
-					interrupts = <17 IRQ_TYPE_LEVEL_HIGH>;
-					#interrupt-cells = <2>;
+			#include "lan966x_pci.dtsi"
+		};
+	};
+};
 
-					tod_pins: tod_pins {
-						pins = "GPIO_36";
-						function = "ptpsync_1";
-					};
+&gpio {
+	tod_pins: tod_pins {
+		pins = "GPIO_36";
+		function = "ptpsync_1";
+	};
+};
 
-					fc0_a_pins: fcb4-i2c-pins {
-						/* RXD, TXD */
-						pins = "GPIO_9", "GPIO_10";
-						function = "fc0_a";
-					};
-				};
+&lan966x_phy0 {
+	status = "okay";
+};
 
-				mdio1: mdio@e200413c {
-					#address-cells = <1>;
-					#size-cells = <0>;
-					compatible = "microchip,lan966x-miim";
-					reg = <0xe200413c 0x24>,
-					      <0xe2010020 0x4>;
+&lan966x_phy1 {
+	status = "okay";
+};
 
-					resets = <&reset 0>;
-					reset-names = "switch";
+&mdio1 {
+	status = "okay";
+};
 
-					lan966x_phy0: ethernet-lan966x_phy@1 {
-						reg = <1>;
-					};
+&port0 {
+	phy-handle = <&lan966x_phy0>;
+	phy-mode = "gmii";
+	phys = <&serdes 0 CU(0)>;
+	status = "okay";
+};
 
-					lan966x_phy1: ethernet-lan966x_phy@2 {
-						reg = <2>;
-					};
-				};
+&port1 {
+	phy-handle = <&lan966x_phy1>;
+	phy-mode = "gmii";
+	phys = <&serdes 1 CU(1)>;
+	status = "okay";
+};
 
-				serdes: serdes@e202c000 {
-					compatible = "microchip,lan966x-serdes";
-					reg = <0xe202c000 0x9c>,
-					      <0xe2004010 0x4>;
-					#phy-cells = <2>;
-				};
-			};
-		};
-	};
+&switch {
+	pinctrl-names = "default";
+	pinctrl-0 = <&tod_pins>;
+	status = "okay";
 };
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v5 23/28] misc: lan966x_pci: Rename lan966x_pci.dtso to lan966x_evb_lan9662_nic.dtso
  2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
                   ` (21 preceding siblings ...)
  2026-02-27 13:54 ` [PATCH v5 22/28] misc: lan966x_pci: Split dtso in dtsi/dtso Herve Codina
@ 2026-02-27 13:54 ` Herve Codina
  2026-02-27 13:54 ` [PATCH v5 24/28] PCI: Add Microchip LAN9662 PCI Device ID Herve Codina
                   ` (4 subsequent siblings)
  27 siblings, 0 replies; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, Steen Hegelund, Luca Ceresoli,
	Thomas Petazzoni

The lan966x_pci.dtso describes the Microchip EVB-LAN9662-NIC board [0]

This PCI board embeds a LAN9962 PCI device chip, part of the LAN966x
family.

Rename the lan966x_pci.dtso accordingly.

Link: https://www.microchip.com/en-us/development-tool/EV53U25A [0]
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
 MAINTAINERS                                               | 2 +-
 drivers/misc/Makefile                                     | 2 +-
 .../{lan966x_pci.dtso => lan966x_evb_lan9662_nic.dtso}    | 0
 drivers/misc/lan966x_pci.c                                | 8 ++++----
 4 files changed, 6 insertions(+), 6 deletions(-)
 rename drivers/misc/{lan966x_pci.dtso => lan966x_evb_lan9662_nic.dtso} (100%)

diff --git a/MAINTAINERS b/MAINTAINERS
index 441fe74e7ef7..2c5537891071 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -17304,9 +17304,9 @@ F:	drivers/irqchip/irq-lan966x-oic.c
 MICROCHIP LAN966X PCI DRIVER
 M:	Herve Codina <herve.codina@bootlin.com>
 S:	Maintained
+F:	drivers/misc/lan966x_evb_lan9662_nic.dtso
 F:	drivers/misc/lan966x_pci.c
 F:	drivers/misc/lan966x_pci.dtsi
-F:	drivers/misc/lan966x_pci.dtso
 
 MICROCHIP LAN969X ETHERNET DRIVER
 M:	Daniel Machon <daniel.machon@microchip.com>
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index b32a2597d246..3b3a61f45ee9 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -70,7 +70,7 @@ obj-$(CONFIG_TPS6594_PFSM)	+= tps6594-pfsm.o
 obj-$(CONFIG_NSM)		+= nsm.o
 obj-$(CONFIG_MARVELL_CN10K_DPI)	+= mrvl_cn10k_dpi.o
 lan966x-pci-objs		:= lan966x_pci.o
-lan966x-pci-objs		+= lan966x_pci.dtbo.o
+lan966x-pci-objs		+= lan966x_evb_lan9662_nic.dtbo.o
 obj-$(CONFIG_MCHP_LAN966X_PCI)	+= lan966x-pci.o
 obj-y				+= keba/
 obj-y				+= amd-sbi/
diff --git a/drivers/misc/lan966x_pci.dtso b/drivers/misc/lan966x_evb_lan9662_nic.dtso
similarity index 100%
rename from drivers/misc/lan966x_pci.dtso
rename to drivers/misc/lan966x_evb_lan9662_nic.dtso
diff --git a/drivers/misc/lan966x_pci.c b/drivers/misc/lan966x_pci.c
index 0bb90c0943bf..bbd87c89663d 100644
--- a/drivers/misc/lan966x_pci.c
+++ b/drivers/misc/lan966x_pci.c
@@ -19,8 +19,8 @@
 #include <linux/slab.h>
 
 /* Embedded dtbo symbols created by cmd_wrap_S_dtb in scripts/Makefile.lib */
-extern char __dtbo_lan966x_pci_begin[];
-extern char __dtbo_lan966x_pci_end[];
+extern char __dtbo_lan966x_evb_lan9662_nic_begin[];
+extern char __dtbo_lan966x_evb_lan9662_nic_end[];
 
 struct pci_dev_intr_ctrl {
 	struct pci_dev *pci_dev;
@@ -125,8 +125,8 @@ struct lan966x_pci {
 
 static int lan966x_pci_load_overlay(struct lan966x_pci *data)
 {
-	u32 dtbo_size = __dtbo_lan966x_pci_end - __dtbo_lan966x_pci_begin;
-	void *dtbo_start = __dtbo_lan966x_pci_begin;
+	u32 dtbo_size = __dtbo_lan966x_evb_lan9662_nic_end - __dtbo_lan966x_evb_lan9662_nic_begin;
+	void *dtbo_start = __dtbo_lan966x_evb_lan9662_nic_begin;
 
 	return of_overlay_fdt_apply(dtbo_start, dtbo_size, &data->ovcs_id, dev_of_node(data->dev));
 }
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v5 24/28] PCI: Add Microchip LAN9662 PCI Device ID
  2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
                   ` (22 preceding siblings ...)
  2026-02-27 13:54 ` [PATCH v5 23/28] misc: lan966x_pci: Rename lan966x_pci.dtso to lan966x_evb_lan9662_nic.dtso Herve Codina
@ 2026-02-27 13:54 ` Herve Codina
  2026-02-27 13:54 ` [PATCH v5 25/28] misc: lan966x_pci: Introduce board specific data Herve Codina
                   ` (3 subsequent siblings)
  27 siblings, 0 replies; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, Steen Hegelund, Luca Ceresoli,
	Thomas Petazzoni

Existing code uses the 0x9660 value (LAN9662 PCI Device ID) in several
places.

Avoid this direct use of the 0x9660 value replacing it by defined PCI
Device ID.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
---
 drivers/misc/lan966x_pci.c | 2 +-
 drivers/pci/quirks.c       | 2 +-
 include/linux/pci_ids.h    | 1 +
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/lan966x_pci.c b/drivers/misc/lan966x_pci.c
index bbd87c89663d..e6d1fce0b116 100644
--- a/drivers/misc/lan966x_pci.c
+++ b/drivers/misc/lan966x_pci.c
@@ -197,7 +197,7 @@ static void lan966x_pci_remove(struct pci_dev *pdev)
 }
 
 static struct pci_device_id lan966x_pci_ids[] = {
-	{ PCI_DEVICE(PCI_VENDOR_ID_EFAR, 0x9660) },
+	{ PCI_DEVICE(PCI_VENDOR_ID_EFAR, PCI_DEVICE_ID_EFAR_LAN9662) },
 	{ }
 };
 MODULE_DEVICE_TABLE(pci, lan966x_pci_ids);
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index a63c24d3901d..cdb81f90f91f 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -6358,7 +6358,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0xa76e, dpc_log_size);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_XILINX, 0x5020, of_pci_make_dev_node);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_XILINX, 0x5021, of_pci_make_dev_node);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_REDHAT, 0x0005, of_pci_make_dev_node);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_EFAR, 0x9660, of_pci_make_dev_node);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_EFAR, PCI_DEVICE_ID_EFAR_LAN9662, of_pci_make_dev_node);
 
 /*
  * Devices known to require a longer delay before first config space access
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 406abf629be2..766684176a51 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -934,6 +934,7 @@
 #define PCI_VENDOR_ID_EFAR		0x1055
 #define PCI_DEVICE_ID_EFAR_SLC90E66_1	0x9130
 #define PCI_DEVICE_ID_EFAR_SLC90E66_3	0x9463
+#define PCI_DEVICE_ID_EFAR_LAN9662	0x9660
 
 #define PCI_VENDOR_ID_MOTOROLA		0x1057
 #define PCI_DEVICE_ID_MOTOROLA_MPC105	0x0001
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v5 25/28] misc: lan966x_pci: Introduce board specific data
  2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
                   ` (23 preceding siblings ...)
  2026-02-27 13:54 ` [PATCH v5 24/28] PCI: Add Microchip LAN9662 PCI Device ID Herve Codina
@ 2026-02-27 13:54 ` Herve Codina
  2026-02-27 13:54 ` [PATCH v5 26/28] misc: lan966x_pci: Add dtsi/dtso nodes in order to support SFPs Herve Codina
                   ` (2 subsequent siblings)
  27 siblings, 0 replies; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, Steen Hegelund, Luca Ceresoli,
	Thomas Petazzoni

Only one device-tree overlay (lan966x_evb_lan9662_nic.dtbo) is handled
and this overlay is directly referenced in lan966x_pci_load_overlay().

This avoid to use the code for an other board.

In order to be more generic and to allow support for other boards (PCI
Vendor/Device IDs), introduce the lan966x_pci_info structure and attach
it to PCI Vendor/Device IDs handled by the driver.

This structure contains information related to the PCI board such as
information related to the dtbo describing the board we have to load.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
 drivers/misc/lan966x_pci.c | 30 ++++++++++++++++++++++--------
 1 file changed, 22 insertions(+), 8 deletions(-)

diff --git a/drivers/misc/lan966x_pci.c b/drivers/misc/lan966x_pci.c
index e6d1fce0b116..041e92f924c4 100644
--- a/drivers/misc/lan966x_pci.c
+++ b/drivers/misc/lan966x_pci.c
@@ -18,10 +18,6 @@
 #include <linux/pci_ids.h>
 #include <linux/slab.h>
 
-/* Embedded dtbo symbols created by cmd_wrap_S_dtb in scripts/Makefile.lib */
-extern char __dtbo_lan966x_evb_lan9662_nic_begin[];
-extern char __dtbo_lan966x_evb_lan9662_nic_end[];
-
 struct pci_dev_intr_ctrl {
 	struct pci_dev *pci_dev;
 	struct irq_domain *irq_domain;
@@ -118,17 +114,23 @@ static int devm_pci_dev_create_intr_ctrl(struct pci_dev *pdev)
 	return devm_add_action_or_reset(&pdev->dev, devm_pci_dev_remove_intr_ctrl, intr_ctrl);
 }
 
+struct lan966x_pci_info {
+	void *dtbo_begin;
+	void *dtbo_end;
+};
+
 struct lan966x_pci {
 	struct device *dev;
 	int ovcs_id;
+	const struct lan966x_pci_info *info;
 };
 
 static int lan966x_pci_load_overlay(struct lan966x_pci *data)
 {
-	u32 dtbo_size = __dtbo_lan966x_evb_lan9662_nic_end - __dtbo_lan966x_evb_lan9662_nic_begin;
-	void *dtbo_start = __dtbo_lan966x_evb_lan9662_nic_begin;
+	const struct lan966x_pci_info *info = data->info;
 
-	return of_overlay_fdt_apply(dtbo_start, dtbo_size, &data->ovcs_id, dev_of_node(data->dev));
+	return of_overlay_fdt_apply(info->dtbo_begin, info->dtbo_end - info->dtbo_begin,
+				    &data->ovcs_id, dev_of_node(data->dev));
 }
 
 static void lan966x_pci_unload_overlay(struct lan966x_pci *data)
@@ -169,6 +171,9 @@ static int lan966x_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
 
 	pci_set_drvdata(pdev, data);
 	data->dev = dev;
+	data->info = (const struct lan966x_pci_info *)id->driver_data;
+	if (!data->info)
+		return -EINVAL;
 
 	ret = lan966x_pci_load_overlay(data);
 	if (ret)
@@ -196,8 +201,17 @@ static void lan966x_pci_remove(struct pci_dev *pdev)
 	lan966x_pci_unload_overlay(data);
 }
 
+/* Embedded dtbo symbols created by cmd_wrap_S_dtb in scripts/Makefile.lib */
+extern char __dtbo_lan966x_evb_lan9662_nic_begin[];
+extern char __dtbo_lan966x_evb_lan9662_nic_end[];
+
+static struct lan966x_pci_info evb_lan9662_nic_info = {
+	.dtbo_begin = __dtbo_lan966x_evb_lan9662_nic_begin,
+	.dtbo_end = __dtbo_lan966x_evb_lan9662_nic_end,
+};
+
 static struct pci_device_id lan966x_pci_ids[] = {
-	{ PCI_DEVICE(PCI_VENDOR_ID_EFAR, PCI_DEVICE_ID_EFAR_LAN9662) },
+	{ PCI_DEVICE_DATA(EFAR, LAN9662, &evb_lan9662_nic_info) },
 	{ }
 };
 MODULE_DEVICE_TABLE(pci, lan966x_pci_ids);
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v5 26/28] misc: lan966x_pci: Add dtsi/dtso nodes in order to support SFPs
  2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
                   ` (24 preceding siblings ...)
  2026-02-27 13:54 ` [PATCH v5 25/28] misc: lan966x_pci: Introduce board specific data Herve Codina
@ 2026-02-27 13:54 ` Herve Codina
  2026-02-27 13:54 ` [PATCH v5 27/28] misc: lan966x_pci: Sort the drivers list in Kconfig help Herve Codina
  2026-02-27 13:54 ` [PATCH v5 28/28] misc: lan966x_pci: Add drivers needed to support SFPs " Herve Codina
  27 siblings, 0 replies; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, Steen Hegelund, Luca Ceresoli,
	Thomas Petazzoni

Add device-tree nodes needed to support SFPs.
Those nodes are:
 - the clock controller
 - the i2c controller
 - the i2c mux
 - the SFPs themselves and their related ports in the switch

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
 drivers/misc/lan966x_evb_lan9662_nic.dtso | 96 +++++++++++++++++++++++
 drivers/misc/lan966x_pci.dtsi             | 42 ++++++++++
 2 files changed, 138 insertions(+)

diff --git a/drivers/misc/lan966x_evb_lan9662_nic.dtso b/drivers/misc/lan966x_evb_lan9662_nic.dtso
index 3ad50abee72d..20e1fe4f78bf 100644
--- a/drivers/misc/lan966x_evb_lan9662_nic.dtso
+++ b/drivers/misc/lan966x_evb_lan9662_nic.dtso
@@ -4,6 +4,7 @@
  */
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/mfd/atmel-flexcom.h>
 #include <dt-bindings/phy/phy-lan966x-serdes.h>
 
 /dts-v1/;
@@ -27,15 +28,94 @@ __overlay__ {
 			#size-cells = <2>;
 
 			#include "lan966x_pci.dtsi"
+
+			i2c0_emux: i2c0-emux {
+				compatible = "i2c-mux-pinctrl";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				i2c-parent = <&i2c0>;
+				pinctrl-names = "i2c102", "i2c103", "idle";
+				pinctrl-0 = <&i2cmux_0>;
+				pinctrl-1 = <&i2cmux_1>;
+				pinctrl-2 = <&i2cmux_pins>;
+
+				i2c102: i2c@0 {
+					reg = <0>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+				};
+
+				i2c103: i2c@1 {
+					reg = <1>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+				};
+			};
+
+			sfp2: sfp2 {
+				compatible = "sff,sfp";
+				i2c-bus = <&i2c102>;
+				tx-disable-gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
+				los-gpios = <&gpio 25 GPIO_ACTIVE_HIGH>;
+				mod-def0-gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
+				tx-fault-gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;
+			};
+
+			sfp3: sfp3 {
+				compatible = "sff,sfp";
+				i2c-bus = <&i2c103>;
+				tx-disable-gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
+				los-gpios = <&gpio 26 GPIO_ACTIVE_HIGH>;
+				mod-def0-gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
+				tx-fault-gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
+			};
 		};
 	};
 };
 
+&flx0 {
+	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
+	status = "okay";
+};
+
+&i2c0 {
+	pinctrl-0 = <&fc0_a_pins>;
+	pinctrl-names = "default";
+	i2c-analog-filter;
+	i2c-digital-filter;
+	i2c-digital-filter-width-ns = <35>;
+	status = "okay";
+};
+
 &gpio {
 	tod_pins: tod_pins {
 		pins = "GPIO_36";
 		function = "ptpsync_1";
 	};
+
+	fc0_a_pins: fcb4-i2c-pins {
+		/* RXD, TXD */
+		pins = "GPIO_9", "GPIO_10";
+		function = "fc0_a";
+	};
+
+	i2cmux_pins: i2cmux-pins {
+		pins = "GPIO_76", "GPIO_77";
+		function = "twi_slc_gate";
+		output-low;
+	};
+
+	i2cmux_0: i2cmux-0 {
+		pins = "GPIO_76";
+		function = "twi_slc_gate";
+		output-high;
+	};
+
+	i2cmux_1: i2cmux-1 {
+		pins = "GPIO_77";
+		function = "twi_slc_gate";
+		output-high;
+	};
 };
 
 &lan966x_phy0 {
@@ -64,6 +144,22 @@ &port1 {
 	status = "okay";
 };
 
+&port2 {
+	phy-mode = "sgmii";
+	phys = <&serdes 2 SERDES6G(0)>;
+	sfp = <&sfp2>;
+	managed = "in-band-status";
+	status = "okay";
+};
+
+&port3 {
+	phy-mode = "sgmii";
+	phys = <&serdes 3 SERDES6G(1)>;
+	sfp = <&sfp3>;
+	managed = "in-band-status";
+	status = "okay";
+};
+
 &switch {
 	pinctrl-names = "default";
 	pinctrl-0 = <&tod_pins>;
diff --git a/drivers/misc/lan966x_pci.dtsi b/drivers/misc/lan966x_pci.dtsi
index 170298084fa5..d5c2056e4e5c 100644
--- a/drivers/misc/lan966x_pci.dtsi
+++ b/drivers/misc/lan966x_pci.dtsi
@@ -3,6 +3,7 @@
  * Copyright (C) 2025 Microchip UNG
  */
 
+#include <dt-bindings/clock/microchip,lan966x.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 
 cpu_clk: clock-600000000 {
@@ -61,6 +62,39 @@ port1: port@1 {
 				reg = <1>;
 				status = "disabled";
 			};
+
+			port2: port@2 {
+				reg = <2>;
+				status = "disabled";
+			};
+
+			port3: port@3 {
+				reg = <3>;
+				status = "disabled";
+			};
+		};
+	};
+
+	flx0: flexcom@e0040000 {
+		compatible = "atmel,sama5d2-flexcom";
+		reg = <0xe0040000 0x100>;
+		clocks = <&clks GCK_ID_FLEXCOM0>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges = <0x0 0xe0040000 0x800>;
+		status = "disabled";
+
+		i2c0: i2c@600 {
+			compatible = "microchip,sam9x60-i2c";
+			reg = <0x600 0x200>;
+			interrupt-parent = <&oic>;
+			interrupts = <48 IRQ_TYPE_LEVEL_HIGH>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			clocks = <&clks GCK_ID_FLEXCOM0>;
+			assigned-clocks = <&clks GCK_ID_FLEXCOM0>;
+			assigned-clock-rates = <20000000>;
+			status = "disabled";
 		};
 	};
 
@@ -69,6 +103,14 @@ cpu_ctrl: syscon@e00c0000 {
 		reg = <0xe00c0000 0xa8>;
 	};
 
+	clks: clock-controller@e00c00a8 {
+		compatible = "microchip,lan966x-gck";
+		#clock-cells = <1>;
+		clocks = <&cpu_clk>, <&ddr_clk>, <&sys_clk>;
+		clock-names = "cpu", "ddr", "sys";
+		reg = <0xe00c00a8 0x38>, <0xe00c02cc 0x4>;
+	};
+
 	oic: oic@e00c0120 {
 		compatible = "microchip,lan966x-oic";
 		#interrupt-cells = <2>;
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v5 27/28] misc: lan966x_pci: Sort the drivers list in Kconfig help
  2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
                   ` (25 preceding siblings ...)
  2026-02-27 13:54 ` [PATCH v5 26/28] misc: lan966x_pci: Add dtsi/dtso nodes in order to support SFPs Herve Codina
@ 2026-02-27 13:54 ` Herve Codina
  2026-02-27 13:54 ` [PATCH v5 28/28] misc: lan966x_pci: Add drivers needed to support SFPs " Herve Codina
  27 siblings, 0 replies; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, Steen Hegelund, Luca Ceresoli,
	Thomas Petazzoni

The LAN966X Kconfig help section mentions drivers related to
devices.

Sort this list alphabetically.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
 drivers/misc/Kconfig | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 5cc79d1517af..9c285a7c88ba 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -635,13 +635,13 @@ config MCHP_LAN966X_PCI
 	  Even if this driver does not depend on those other drivers, in order
 	  to have a fully functional board, the following drivers are needed:
 	    - fixed-clock (COMMON_CLK)
-	    - lan966x-oic (LAN966X_OIC)
 	    - lan966x-cpu-syscon (MFD_SYSCON)
-	    - lan966x-switch-reset (RESET_MCHP_SPARX5)
+	    - lan966x-miim (MDIO_MSCC_MIIM)
+	    - lan966x-oic (LAN966X_OIC)
 	    - lan966x-pinctrl (PINCTRL_OCELOT)
 	    - lan966x-serdes (PHY_LAN966X_SERDES)
-	    - lan966x-miim (MDIO_MSCC_MIIM)
 	    - lan966x-switch (LAN966X_SWITCH)
+	    - lan966x-switch-reset (RESET_MCHP_SPARX5)
 
 source "drivers/misc/c2port/Kconfig"
 source "drivers/misc/eeprom/Kconfig"
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* [PATCH v5 28/28] misc: lan966x_pci: Add drivers needed to support SFPs in Kconfig help
  2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
                   ` (26 preceding siblings ...)
  2026-02-27 13:54 ` [PATCH v5 27/28] misc: lan966x_pci: Sort the drivers list in Kconfig help Herve Codina
@ 2026-02-27 13:54 ` Herve Codina
  27 siblings, 0 replies; 46+ messages in thread
From: Herve Codina @ 2026-02-27 13:54 UTC (permalink / raw)
  To: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Herve Codina, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo
  Cc: Wolfram Sang, linux-kernel, driver-core, imx, linux-arm-kernel,
	linux-clk, linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, Steen Hegelund, Luca Ceresoli,
	Thomas Petazzoni

Recently, new device-tree nodes were added in the overlay to add support
for SFPs on LAN966x PCI device.

The LAN966X Kconfig help section mentions drivers related to devices
added based on the overlay description.

Add drivers related to devices described by those new nodes in the
already existing driver list.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
 drivers/misc/Kconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 9c285a7c88ba..69825dc0f85e 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -635,13 +635,18 @@ config MCHP_LAN966X_PCI
 	  Even if this driver does not depend on those other drivers, in order
 	  to have a fully functional board, the following drivers are needed:
 	    - fixed-clock (COMMON_CLK)
+	    - i2c-mux-pinctrl (I2C_MUX_PINCTRL)
 	    - lan966x-cpu-syscon (MFD_SYSCON)
+	    - lan966x-gck (COMMON_CLK_LAN966X)
 	    - lan966x-miim (MDIO_MSCC_MIIM)
 	    - lan966x-oic (LAN966X_OIC)
 	    - lan966x-pinctrl (PINCTRL_OCELOT)
 	    - lan966x-serdes (PHY_LAN966X_SERDES)
 	    - lan966x-switch (LAN966X_SWITCH)
 	    - lan966x-switch-reset (RESET_MCHP_SPARX5)
+	    - sam9x60-i2c (I2C_AT91)
+	    - sama5d2-flexcom (MFD_ATMEL_FLEXCOM)
+	    - sfp (SFP)
 
 source "drivers/misc/c2port/Kconfig"
 source "drivers/misc/eeprom/Kconfig"
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 46+ messages in thread

* Re: [PATCH v5 09/28] pinctrl: cs42l43: Use fw_devlink_set_device()
  2026-02-27 13:54 ` [PATCH v5 09/28] pinctrl: cs42l43: " Herve Codina
@ 2026-02-27 14:11   ` Linus Walleij
  2026-02-27 14:22     ` Herve Codina
  2026-02-27 15:58   ` Charles Keepax
  1 sibling, 1 reply; 46+ messages in thread
From: Linus Walleij @ 2026-02-27 14:11 UTC (permalink / raw)
  To: Herve Codina
  Cc: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Saravana Kannan, Bjorn Helgaas,
	Charles Keepax, Richard Fitzgerald, David Rhodes, Ulf Hansson,
	Mark Brown, Len Brown, Andy Shevchenko, Daniel Scally,
	Heikki Krogerus, Sakari Ailus, Davidlohr Bueso, Jonathan Cameron,
	Dave Jiang, Alison Schofield, Vishal Verma, Ira Weiny,
	Dan Williams, Shawn Guo, Wolfram Sang, linux-kernel, driver-core,
	imx, linux-arm-kernel, linux-clk, linux-i2c, devicetree,
	linux-pci, linux-sound, patches, linux-gpio, linux-pm, linux-spi,
	linux-acpi, linux-cxl, Allan Nielsen, Horatiu Vultur,
	Steen Hegelund, Luca Ceresoli, Thomas Petazzoni

On Fri, Feb 27, 2026 at 2:57 PM Herve Codina <herve.codina@bootlin.com> wrote:

> 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>

Acked-by: Linus Walleij <linusw@kernel.org>

Tell me if I should apply this directly to the pinctrl tree, right
now I'm under the impression that all patches need to go in
together?

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v5 09/28] pinctrl: cs42l43: Use fw_devlink_set_device()
  2026-02-27 14:11   ` Linus Walleij
@ 2026-02-27 14:22     ` Herve Codina
  0 siblings, 0 replies; 46+ messages in thread
From: Herve Codina @ 2026-02-27 14:22 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Saravana Kannan, Bjorn Helgaas,
	Charles Keepax, Richard Fitzgerald, David Rhodes, Ulf Hansson,
	Mark Brown, Len Brown, Andy Shevchenko, Daniel Scally,
	Heikki Krogerus, Sakari Ailus, Davidlohr Bueso, Jonathan Cameron,
	Dave Jiang, Alison Schofield, Vishal Verma, Ira Weiny,
	Dan Williams, Shawn Guo, Wolfram Sang, linux-kernel, driver-core,
	imx, linux-arm-kernel, linux-clk, linux-i2c, devicetree,
	linux-pci, linux-sound, patches, linux-gpio, linux-pm, linux-spi,
	linux-acpi, linux-cxl, Allan Nielsen, Horatiu Vultur,
	Steen Hegelund, Luca Ceresoli, Thomas Petazzoni

Hi Linus,

On Fri, 27 Feb 2026 15:11:13 +0100
Linus Walleij <linusw@kernel.org> wrote:

> On Fri, Feb 27, 2026 at 2:57 PM Herve Codina <herve.codina@bootlin.com> wrote:
> 
> > 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>  
> 
> Acked-by: Linus Walleij <linusw@kernel.org>
> 
> Tell me if I should apply this directly to the pinctrl tree, right
> now I'm under the impression that all patches need to go in
> together?

This patch depends on patch 7.

I think it could make sense to have patches 7 to 12 applied by the same
maintainer.

Best regards,
Hervé

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v5 07/28] driver core: fw_devlink: Introduce fw_devlink_set_device()
  2026-02-27 13:54 ` [PATCH v5 07/28] driver core: fw_devlink: Introduce fw_devlink_set_device() Herve Codina
@ 2026-02-27 15:57   ` Charles Keepax
  2026-03-02 12:23   ` Jonathan Cameron
  1 sibling, 0 replies; 46+ messages in thread
From: Charles Keepax @ 2026-02-27 15:57 UTC (permalink / raw)
  To: Herve Codina
  Cc: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Saravana Kannan, Bjorn Helgaas,
	Richard Fitzgerald, David Rhodes, Linus Walleij, Ulf Hansson,
	Mark Brown, Len Brown, Andy Shevchenko, Daniel Scally,
	Heikki Krogerus, Sakari Ailus, Davidlohr Bueso, Jonathan Cameron,
	Dave Jiang, Alison Schofield, Vishal Verma, Ira Weiny,
	Dan Williams, Shawn Guo, Wolfram Sang, linux-kernel, driver-core,
	imx, linux-arm-kernel, linux-clk, linux-i2c, devicetree,
	linux-pci, linux-sound, patches, linux-gpio, linux-pm, linux-spi,
	linux-acpi, linux-cxl, Allan Nielsen, Horatiu Vultur,
	Steen Hegelund, Luca Ceresoli, Thomas Petazzoni

On Fri, Feb 27, 2026 at 02:54:04PM +0100, Herve Codina wrote:
> 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.
> 
> 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>

Thanks,
Charles

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v5 09/28] pinctrl: cs42l43: Use fw_devlink_set_device()
  2026-02-27 13:54 ` [PATCH v5 09/28] pinctrl: cs42l43: " Herve Codina
  2026-02-27 14:11   ` Linus Walleij
@ 2026-02-27 15:58   ` Charles Keepax
  1 sibling, 0 replies; 46+ messages in thread
From: Charles Keepax @ 2026-02-27 15:58 UTC (permalink / raw)
  To: Herve Codina
  Cc: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Saravana Kannan, Bjorn Helgaas,
	Richard Fitzgerald, David Rhodes, Linus Walleij, Ulf Hansson,
	Mark Brown, Len Brown, Andy Shevchenko, Daniel Scally,
	Heikki Krogerus, Sakari Ailus, Davidlohr Bueso, Jonathan Cameron,
	Dave Jiang, Alison Schofield, Vishal Verma, Ira Weiny,
	Dan Williams, Shawn Guo, Wolfram Sang, linux-kernel, driver-core,
	imx, linux-arm-kernel, linux-clk, linux-i2c, devicetree,
	linux-pci, linux-sound, patches, linux-gpio, linux-pm, linux-spi,
	linux-acpi, linux-cxl, Allan Nielsen, Horatiu Vultur,
	Steen Hegelund, Luca Ceresoli, Thomas Petazzoni

On Fri, Feb 27, 2026 at 02:54:06PM +0100, Herve Codina wrote:
> 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>

Thanks,
Charles

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v5 03/28] of: dynamic: Fix overlayed devices not probing because of fw_devlink
  2026-02-27 13:54 ` [PATCH v5 03/28] of: dynamic: Fix overlayed devices not probing because of fw_devlink Herve Codina
@ 2026-02-27 16:50   ` Geert Uytterhoeven
  2026-03-03 14:58   ` Kalle Niemi
  1 sibling, 0 replies; 46+ messages in thread
From: Geert Uytterhoeven @ 2026-02-27 16:50 UTC (permalink / raw)
  To: Herve Codina
  Cc: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Kalle Niemi, Matti Vaittinen, Greg Kroah-Hartman,
	Rafael J. Wysocki, Danilo Krummrich, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Michael Turquette,
	Stephen Boyd, Andi Shyti, Wolfram Sang, Peter Rosin,
	Arnd Bergmann, Saravana Kannan, Bjorn Helgaas, Charles Keepax,
	Richard Fitzgerald, David Rhodes, Linus Walleij, Ulf Hansson,
	Mark Brown, Len Brown, Andy Shevchenko, Daniel Scally,
	Heikki Krogerus, Sakari Ailus, Davidlohr Bueso, Jonathan Cameron,
	Dave Jiang, Alison Schofield, Vishal Verma, Ira Weiny,
	Dan Williams, Shawn Guo, Wolfram Sang, linux-kernel, driver-core,
	imx, linux-arm-kernel, linux-clk, linux-i2c, devicetree,
	linux-pci, linux-sound, patches, linux-gpio, linux-pm, linux-spi,
	linux-acpi, linux-cxl, Allan Nielsen, Horatiu Vultur,
	Steen Hegelund, Luca Ceresoli, Thomas Petazzoni, Saravana Kannan

Hi Hervé,

On Fri, 27 Feb 2026 at 14:56, Herve Codina <herve.codina@bootlin.com> wrote:
> From: Saravana Kannan <saravanak@google.com>
>
> When an overlay is applied, if the target device has already probed
> successfully and bound to a device, then some of the fw_devlink logic
> that ran when the device was probed needs to be rerun. This allows newly
> created dangling consumers of the overlayed device tree nodes to be
> moved to become consumers of the target device.
>
> Fixes: 1a50d9403fb9 ("treewide: Fix probing of devices in DT overlays")
> Reported-by: Herve Codina <herve.codina@bootlin.com>
> Closes: https://lore.kernel.org/lkml/CAMuHMdXEnSD4rRJ-o90x4OprUacN_rJgyo8x6=9F9rZ+-KzjOg@mail.gmail.com/
> Closes: https://lore.kernel.org/all/20240221095137.616d2aaa@bootlin.com/
> Closes: https://lore.kernel.org/lkml/20240312151835.29ef62a0@bootlin.com/
> Signed-off-by: Saravana Kannan <saravanak@google.com>
> Link: https://lore.kernel.org/lkml/20240411235623.1260061-3-saravanak@google.com/
> [Herve: Rebase on top of recent kernel and use get_device_from_fwnode()]
> [Herve: Add the call to driver_deferred_probe_trigger()]

Thanks, that last change did the trick, finally!

> Signed-off-by: Herve Codina <herve.codina@bootlin.com>

Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>

> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -235,6 +235,79 @@ static void __fw_devlink_pickup_dangling_consumers(struct fwnode_handle *fwnode,
>                 __fw_devlink_pickup_dangling_consumers(child, new_sup);
>  }
>
> +static void fw_devlink_pickup_dangling_consumers(struct device *dev)
> +{
> +       struct fwnode_handle *child;
> +
> +       guard(mutex)(&fwnode_link_lock);
> +
> +       fwnode_for_each_available_child_node(dev->fwnode, child)
> +               __fw_devlink_pickup_dangling_consumers(child, dev->fwnode);
> +       __fw_devlink_link_to_consumers(dev);
> +}
> +
> +/**
> + * fw_devlink_refresh_fwnode - Recheck the tree under this firmware node
> + * @fwnode: The fwnode under which the fwnode tree has changed
> + *
> + * This function is mainly meant to adjust the supplier/consumer dependencies
> + * after a fwnode tree overlay has occurred.
> + */
> +void fw_devlink_refresh_fwnode(struct fwnode_handle *fwnode)
> +{
> +       struct device *dev;
> +
> +       /*
> +        * Find the closest ancestor fwnode that has been converted to a device
> +        * that can bind to a driver (bus device).
> +        */
> +       fwnode_handle_get(fwnode);
> +       do {
> +               if (fwnode->flags & FWNODE_FLAG_NOT_DEVICE)
> +                       continue;
> +
> +               dev = get_device_from_fwnode(fwnode);
> +               if (!dev)
> +                       continue;
> +
> +               if (dev->bus)
> +                       break;
> +
> +               put_device(dev);
> +       } while ((fwnode = fwnode_get_next_parent(fwnode)));
> +
> +       /*
> +        * If none of the ancestor fwnodes have (yet) been converted to a device
> +        * that can bind to a driver, there's nothing to fix up.
> +        */
> +       if (!fwnode)
> +               return;
> +
> +       WARN(device_is_bound(dev) && dev->links.status != DL_DEV_DRIVER_BOUND,
> +            "Don't multithread overlaying and probing the same device!\n");
> +
> +       /*
> +        * If the device has already bound to a driver, then we need to redo
> +        * some of the work that was done after the device was bound to a
> +        * driver. If the device hasn't bound to a driver, running thing too

things

> +        * soon would incorrectly pick up consumers that it shouldn't.
> +        */
> +       if (dev->links.status == DL_DEV_DRIVER_BOUND) {
> +               fw_devlink_pickup_dangling_consumers(dev);
> +               /*
> +                * Some of dangling consumers could have been put previously in
> +                * the deferred probe list due to the unavailability of their
> +                * suppliers. Those consumers have been picked up and some of
> +                * their suppliers links have been update. Time to re-try their

updated

> +                * probe sequence.
> +                */
> +               driver_deferred_probe_trigger();
> +       }
> +
> +       put_device(dev);
> +       fwnode_handle_put(fwnode);
> +}
> +
>  static DEFINE_MUTEX(device_links_lock);
>  DEFINE_STATIC_SRCU(device_links_srcu);
>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v5 10/28] cxl/test: Use device_set_node()
  2026-02-27 13:54 ` [PATCH v5 10/28] cxl/test: Use device_set_node() Herve Codina
@ 2026-03-02 12:21   ` Jonathan Cameron
  0 siblings, 0 replies; 46+ messages in thread
From: Jonathan Cameron @ 2026-03-02 12:21 UTC (permalink / raw)
  To: Herve Codina
  Cc: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Saravana Kannan, Bjorn Helgaas,
	Charles Keepax, Richard Fitzgerald, David Rhodes, Linus Walleij,
	Ulf Hansson, Mark Brown, Len Brown, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Sakari Ailus, Davidlohr Bueso,
	Dave Jiang, Alison Schofield, Vishal Verma, Ira Weiny,
	Dan Williams, Shawn Guo, Wolfram Sang, linux-kernel, driver-core,
	imx, linux-arm-kernel, linux-clk, linux-i2c, devicetree,
	linux-pci, linux-sound, patches, linux-gpio, linux-pm, linux-spi,
	linux-acpi, linux-cxl, Allan Nielsen, Horatiu Vultur,
	Steen Hegelund, Luca Ceresoli, Thomas Petazzoni

On Fri, 27 Feb 2026 14:54:07 +0100
Herve Codina <herve.codina@bootlin.com> wrote:

> 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 81e2aef3627a..3d9107b2661c 100644
> --- a/tools/testing/cxl/test/cxl.c
> +++ b/tools/testing/cxl/test/cxl.c
> @@ -1136,7 +1136,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;
>  }
>  


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v5 07/28] driver core: fw_devlink: Introduce fw_devlink_set_device()
  2026-02-27 13:54 ` [PATCH v5 07/28] driver core: fw_devlink: Introduce fw_devlink_set_device() Herve Codina
  2026-02-27 15:57   ` Charles Keepax
@ 2026-03-02 12:23   ` Jonathan Cameron
  2026-03-03 14:12     ` Herve Codina
  1 sibling, 1 reply; 46+ messages in thread
From: Jonathan Cameron @ 2026-03-02 12:23 UTC (permalink / raw)
  To: Herve Codina
  Cc: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Saravana Kannan, Bjorn Helgaas,
	Charles Keepax, Richard Fitzgerald, David Rhodes, Linus Walleij,
	Ulf Hansson, Mark Brown, Len Brown, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Sakari Ailus, Davidlohr Bueso,
	Dave Jiang, Alison Schofield, Vishal Verma, Ira Weiny,
	Dan Williams, Shawn Guo, Wolfram Sang, linux-kernel, driver-core,
	imx, linux-arm-kernel, linux-clk, linux-i2c, devicetree,
	linux-pci, linux-sound, patches, linux-gpio, linux-pm, linux-spi,
	linux-acpi, linux-cxl, Allan Nielsen, Horatiu Vultur,
	Steen Hegelund, Luca Ceresoli, Thomas Petazzoni

On Fri, 27 Feb 2026 14:54:04 +0100
Herve Codina <herve.codina@bootlin.com> wrote:

> 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.
> 
I don't mind the helper, but the description could do with a little
detail on why.  Is it just to avoid visibility of internal details, or
is there a stronger reason?

> 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>
> ---
>  include/linux/fwnode.h | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h
> index a921ca2fe940..a1345e274125 100644
> --- a/include/linux/fwnode.h
> +++ b/include/linux/fwnode.h
> @@ -231,4 +231,10 @@ void fw_devlink_purge_absent_suppliers(struct fwnode_handle *fwnode);
>  void fw_devlink_refresh_fwnode(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


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v5 11/28] cxl/test: Use fw_devlink_set_device()
  2026-02-27 13:54 ` [PATCH v5 11/28] cxl/test: Use fw_devlink_set_device() Herve Codina
@ 2026-03-02 12:24   ` Jonathan Cameron
  2026-03-03 14:28     ` Herve Codina
  0 siblings, 1 reply; 46+ messages in thread
From: Jonathan Cameron @ 2026-03-02 12:24 UTC (permalink / raw)
  To: Herve Codina
  Cc: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Saravana Kannan, Bjorn Helgaas,
	Charles Keepax, Richard Fitzgerald, David Rhodes, Linus Walleij,
	Ulf Hansson, Mark Brown, Len Brown, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Sakari Ailus, Davidlohr Bueso,
	Dave Jiang, Alison Schofield, Vishal Verma, Ira Weiny,
	Dan Williams, Shawn Guo, Wolfram Sang, linux-kernel, driver-core,
	imx, linux-arm-kernel, linux-clk, linux-i2c, devicetree,
	linux-pci, linux-sound, patches, linux-gpio, linux-pm, linux-spi,
	linux-acpi, linux-cxl, Allan Nielsen, Horatiu Vultur,
	Steen Hegelund, Luca Ceresoli, Thomas Petazzoni

On Fri, 27 Feb 2026 14:54:08 +0100
Herve Codina <herve.codina@bootlin.com> wrote:

> 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>

From practical point of view, what path do you expect this to take?
Is there urgency to make the change, or does it make more sense to
add the helper this cycle and cleanup up the various places it can be
used next?

> ---
>  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 3d9107b2661c..7f232a869389 100644
> --- a/tools/testing/cxl/test/cxl.c
> +++ b/tools/testing/cxl/test/cxl.c
> @@ -1137,7 +1137,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


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v5 07/28] driver core: fw_devlink: Introduce fw_devlink_set_device()
  2026-03-02 12:23   ` Jonathan Cameron
@ 2026-03-03 14:12     ` Herve Codina
  2026-03-03 15:24       ` Andy Shevchenko
  0 siblings, 1 reply; 46+ messages in thread
From: Herve Codina @ 2026-03-03 14:12 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Saravana Kannan, Bjorn Helgaas,
	Charles Keepax, Richard Fitzgerald, David Rhodes, Linus Walleij,
	Ulf Hansson, Mark Brown, Len Brown, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Sakari Ailus, Davidlohr Bueso,
	Dave Jiang, Alison Schofield, Vishal Verma, Ira Weiny,
	Dan Williams, Shawn Guo, Wolfram Sang, linux-kernel, driver-core,
	imx, linux-arm-kernel, linux-clk, linux-i2c, devicetree,
	linux-pci, linux-sound, patches, linux-gpio, linux-pm, linux-spi,
	linux-acpi, linux-cxl, Allan Nielsen, Horatiu Vultur,
	Steen Hegelund, Luca Ceresoli, Thomas Petazzoni

Hi Jonathan,

On Mon, 2 Mar 2026 12:23:36 +0000
Jonathan Cameron <jonathan.cameron@huawei.com> wrote:

> On Fri, 27 Feb 2026 14:54:04 +0100
> Herve Codina <herve.codina@bootlin.com> wrote:
> 
> > 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.
> >   
> I don't mind the helper, but the description could do with a little
> detail on why.  Is it just to avoid visibility of internal details, or
> is there a stronger reason?

I think the idea was to avoid visibility.

It cames from feedback received on my first iteration
  https://lore.kernel.org/all/20250408145139.293c79a2@bootlin.com/

I found the idea relevant and so I did the patch.

Best regards,
Hervé


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v5 11/28] cxl/test: Use fw_devlink_set_device()
  2026-03-02 12:24   ` Jonathan Cameron
@ 2026-03-03 14:28     ` Herve Codina
  0 siblings, 0 replies; 46+ messages in thread
From: Herve Codina @ 2026-03-03 14:28 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Saravana Kannan, Bjorn Helgaas,
	Charles Keepax, Richard Fitzgerald, David Rhodes, Linus Walleij,
	Ulf Hansson, Mark Brown, Len Brown, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Sakari Ailus, Davidlohr Bueso,
	Dave Jiang, Alison Schofield, Vishal Verma, Ira Weiny,
	Dan Williams, Shawn Guo, Wolfram Sang, linux-kernel, driver-core,
	imx, linux-arm-kernel, linux-clk, linux-i2c, devicetree,
	linux-pci, linux-sound, patches, linux-gpio, linux-pm, linux-spi,
	linux-acpi, linux-cxl, Allan Nielsen, Horatiu Vultur,
	Steen Hegelund, Luca Ceresoli, Thomas Petazzoni

Hi Jonathan,

On Mon, 2 Mar 2026 12:24:49 +0000
Jonathan Cameron <jonathan.cameron@huawei.com> wrote:

> On Fri, 27 Feb 2026 14:54:08 +0100
> Herve Codina <herve.codina@bootlin.com> wrote:
> 
> > 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>
> 
> From practical point of view, what path do you expect this to take?
> Is there urgency to make the change, or does it make more sense to
> add the helper this cycle and cleanup up the various places it can be
> used next?

I hoped to have patches 7 to 12 applied by one maintainer on his/her trees.

As it is related to fw_devlink, I expect to have them applied by a driver
core maintainer.

Any other plan can work as well.

Best regards,
Hervé


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v5 03/28] of: dynamic: Fix overlayed devices not probing because of fw_devlink
  2026-02-27 13:54 ` [PATCH v5 03/28] of: dynamic: Fix overlayed devices not probing because of fw_devlink Herve Codina
  2026-02-27 16:50   ` Geert Uytterhoeven
@ 2026-03-03 14:58   ` Kalle Niemi
  1 sibling, 0 replies; 46+ messages in thread
From: Kalle Niemi @ 2026-03-03 14:58 UTC (permalink / raw)
  To: Herve Codina
  Cc: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Matti Vaittinen, Greg Kroah-Hartman,
	Rafael J. Wysocki, Danilo Krummrich, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Michael Turquette,
	Stephen Boyd, Andi Shyti, Wolfram Sang, Peter Rosin,
	Arnd Bergmann, Saravana Kannan, Bjorn Helgaas, Charles Keepax,
	Richard Fitzgerald, David Rhodes, Linus Walleij, Ulf Hansson,
	Mark Brown, Len Brown, Andy Shevchenko, Daniel Scally,
	Heikki Krogerus, Sakari Ailus, Davidlohr Bueso, Jonathan Cameron,
	Dave Jiang, Alison Schofield, Vishal Verma, Ira Weiny,
	Dan Williams, Shawn Guo, Wolfram Sang, linux-kernel, driver-core,
	imx, linux-arm-kernel, linux-clk, linux-i2c, devicetree,
	linux-pci, linux-sound, patches, linux-gpio, linux-pm, linux-spi,
	linux-acpi, linux-cxl, Allan Nielsen, Horatiu Vultur,
	Steen Hegelund, Luca Ceresoli, Thomas Petazzoni, Saravana Kannan

On 27. Feb 2026, at 15.54, Herve Codina <herve.codina@bootlin.com> wrote:
> 
> From: Saravana Kannan <saravanak@google.com>
> 
> When an overlay is applied, if the target device has already probed
> successfully and bound to a device, then some of the fw_devlink logic
> that ran when the device was probed needs to be rerun. This allows newly
> created dangling consumers of the overlayed device tree nodes to be
> moved to become consumers of the target device.
> 
> Fixes: 1a50d9403fb9 ("treewide: Fix probing of devices in DT overlays")
> Reported-by: Herve Codina <herve.codina@bootlin.com>
> Closes: https://lore.kernel.org/lkml/CAMuHMdXEnSD4rRJ-o90x4OprUacN_rJgyo8x6=9F9rZ+-KzjOg@mail.gmail.com/
> Closes: https://lore.kernel.org/all/20240221095137.616d2aaa@bootlin.com/
> Closes: https://lore.kernel.org/lkml/20240312151835.29ef62a0@bootlin.com/
> Signed-off-by: Saravana Kannan <saravanak@google.com>
> Link: https://lore.kernel.org/lkml/20240411235623.1260061-3-saravanak@google.com/
> [Herve: Rebase on top of recent kernel and use get_device_from_fwnode()]
> [Herve: Add the call to driver_deferred_probe_trigger()]
> Signed-off-by: Herve Codina <herve.codina@bootlin.com>
> 

Hello Hervé,

Tested this patch series with BeagleBone Black and all tests pass. bd718x7 driver probes.

Tested-by: Kalle Niemi <kaleposti@gmail.com>

BR
Kalle

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v5 07/28] driver core: fw_devlink: Introduce fw_devlink_set_device()
  2026-03-03 14:12     ` Herve Codina
@ 2026-03-03 15:24       ` Andy Shevchenko
  0 siblings, 0 replies; 46+ messages in thread
From: Andy Shevchenko @ 2026-03-03 15:24 UTC (permalink / raw)
  To: Herve Codina
  Cc: Jonathan Cameron, Andrew Lunn, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, Kalle Niemi, Matti Vaittinen,
	Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Saravana Kannan, Bjorn Helgaas,
	Charles Keepax, Richard Fitzgerald, David Rhodes, Linus Walleij,
	Ulf Hansson, Mark Brown, Len Brown, Daniel Scally,
	Heikki Krogerus, Sakari Ailus, Davidlohr Bueso, Dave Jiang,
	Alison Schofield, Vishal Verma, Ira Weiny, Dan Williams,
	Shawn Guo, Wolfram Sang, linux-kernel, driver-core, imx,
	linux-arm-kernel, linux-clk, linux-i2c, devicetree, linux-pci,
	linux-sound, patches, linux-gpio, linux-pm, linux-spi, linux-acpi,
	linux-cxl, Allan Nielsen, Horatiu Vultur, Steen Hegelund,
	Luca Ceresoli, Thomas Petazzoni

On Tue, Mar 03, 2026 at 03:12:10PM +0100, Herve Codina wrote:
> On Mon, 2 Mar 2026 12:23:36 +0000
> Jonathan Cameron <jonathan.cameron@huawei.com> wrote:
> > On Fri, 27 Feb 2026 14:54:04 +0100
> > Herve Codina <herve.codina@bootlin.com> wrote:
> > 
> > > 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.
> > >   
> > I don't mind the helper, but the description could do with a little
> > detail on why.  Is it just to avoid visibility of internal details, or
> > is there a stronger reason?
> 
> I think the idea was to avoid visibility.
> 
> It cames from feedback received on my first iteration
>   https://lore.kernel.org/all/20250408145139.293c79a2@bootlin.com/
> 
> I found the idea relevant and so I did the patch.

Yes, the idea is to hide the fwnode devlink related stuff behind the getters
and setters. Ideally, everything in fwnode_handle related to devlinks should
be marked as __private.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v5 02/28] driver core: Rename get_dev_from_fwnode() wrapper to get_device_from_fwnode()
  2026-02-27 13:53 ` [PATCH v5 02/28] driver core: Rename get_dev_from_fwnode() wrapper to get_device_from_fwnode() Herve Codina
@ 2026-03-10 15:03   ` Geert Uytterhoeven
  2026-03-12 15:27     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 46+ messages in thread
From: Geert Uytterhoeven @ 2026-03-10 15:03 UTC (permalink / raw)
  To: Herve Codina
  Cc: Andrew Lunn, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Kalle Niemi, Matti Vaittinen, Greg Kroah-Hartman,
	Rafael J. Wysocki, Danilo Krummrich, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Michael Turquette,
	Stephen Boyd, Andi Shyti, Wolfram Sang, Peter Rosin,
	Arnd Bergmann, Saravana Kannan, Bjorn Helgaas, Charles Keepax,
	Richard Fitzgerald, David Rhodes, Linus Walleij, Ulf Hansson,
	Mark Brown, Len Brown, Andy Shevchenko, Daniel Scally,
	Heikki Krogerus, Sakari Ailus, Davidlohr Bueso, Jonathan Cameron,
	Dave Jiang, Alison Schofield, Vishal Verma, Ira Weiny,
	Dan Williams, Shawn Guo, Wolfram Sang, linux-kernel, driver-core,
	imx, linux-arm-kernel, linux-clk, linux-i2c, devicetree,
	linux-pci, linux-sound, patches, linux-gpio, linux-pm, linux-spi,
	linux-acpi, linux-cxl, Allan Nielsen, Horatiu Vultur,
	Steen Hegelund, Luca Ceresoli, Thomas Petazzoni, Saravana Kannan,
	Bartosz Golaszewski

Hi Hervé,

On Fri, 27 Feb 2026 at 14:55, Herve Codina <herve.codina@bootlin.com> wrote:
> get_dev_from_fwnode() calls get_device() and so it acquires a reference
> on the device returned.
>
> In order to be more obvious that this wrapper is a get_device() variant,
> rename it to get_device_from_fwnode().
>
> Suggested-by: Mark Brown <broonie@kernel.org>
> Link: https://lore.kernel.org/lkml/CAGETcx97QjnjVR8Z5g0ndLHpK96hLd4aYSV=iEkKPNbNOccYmA@mail.gmail.com/
> Signed-off-by: Herve Codina <herve.codina@bootlin.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Reviewed-by: Saravana Kannan <saravanak@google.com>
> Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
> Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

FTR, one more user of get_dev_from_fwnode() appeared in commit
9035073d0ef1de81 ("reset: convert reset core to using firmware nodes")
in reset/next.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v5 02/28] driver core: Rename get_dev_from_fwnode() wrapper to get_device_from_fwnode()
  2026-03-10 15:03   ` Geert Uytterhoeven
@ 2026-03-12 15:27     ` Greg Kroah-Hartman
  2026-03-13  9:43       ` Ulf Hansson
  0 siblings, 1 reply; 46+ messages in thread
From: Greg Kroah-Hartman @ 2026-03-12 15:27 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Herve Codina, Andrew Lunn, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Kalle Niemi, Matti Vaittinen, Rafael J. Wysocki,
	Danilo Krummrich, Frank Li, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Michael Turquette, Stephen Boyd, Andi Shyti,
	Wolfram Sang, Peter Rosin, Arnd Bergmann, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Ulf Hansson, Mark Brown, Len Brown,
	Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams, Shawn Guo, Wolfram Sang,
	linux-kernel, driver-core, imx, linux-arm-kernel, linux-clk,
	linux-i2c, devicetree, linux-pci, linux-sound, patches,
	linux-gpio, linux-pm, linux-spi, linux-acpi, linux-cxl,
	Allan Nielsen, Horatiu Vultur, Steen Hegelund, Luca Ceresoli,
	Thomas Petazzoni, Saravana Kannan, Bartosz Golaszewski

On Tue, Mar 10, 2026 at 04:03:42PM +0100, Geert Uytterhoeven wrote:
> Hi Hervé,
> 
> On Fri, 27 Feb 2026 at 14:55, Herve Codina <herve.codina@bootlin.com> wrote:
> > get_dev_from_fwnode() calls get_device() and so it acquires a reference
> > on the device returned.
> >
> > In order to be more obvious that this wrapper is a get_device() variant,
> > rename it to get_device_from_fwnode().
> >
> > Suggested-by: Mark Brown <broonie@kernel.org>
> > Link: https://lore.kernel.org/lkml/CAGETcx97QjnjVR8Z5g0ndLHpK96hLd4aYSV=iEkKPNbNOccYmA@mail.gmail.com/
> > Signed-off-by: Herve Codina <herve.codina@bootlin.com>
> > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Reviewed-by: Saravana Kannan <saravanak@google.com>
> > Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
> > Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
> 
> FTR, one more user of get_dev_from_fwnode() appeared in commit
> 9035073d0ef1de81 ("reset: convert reset core to using firmware nodes")
> in reset/next.

Ick, that's going to make this hard to land anywhere.  This is a rough
series, perhaps it should be split up to make it easier somehow?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v5 02/28] driver core: Rename get_dev_from_fwnode() wrapper to get_device_from_fwnode()
  2026-03-12 15:27     ` Greg Kroah-Hartman
@ 2026-03-13  9:43       ` Ulf Hansson
  2026-03-13 11:20         ` Herve Codina
  0 siblings, 1 reply; 46+ messages in thread
From: Ulf Hansson @ 2026-03-13  9:43 UTC (permalink / raw)
  To: Herve Codina, Greg Kroah-Hartman
  Cc: Geert Uytterhoeven, Andrew Lunn, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Kalle Niemi, Matti Vaittinen, Rafael J. Wysocki,
	Danilo Krummrich, Frank Li, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Michael Turquette, Stephen Boyd, Andi Shyti,
	Wolfram Sang, Peter Rosin, Arnd Bergmann, Saravana Kannan,
	Bjorn Helgaas, Charles Keepax, Richard Fitzgerald, David Rhodes,
	Linus Walleij, Mark Brown, Len Brown, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Sakari Ailus, Davidlohr Bueso,
	Jonathan Cameron, Dave Jiang, Alison Schofield, Vishal Verma,
	Ira Weiny, Dan Williams, Shawn Guo, Wolfram Sang, linux-kernel,
	driver-core, imx, linux-arm-kernel, linux-clk, linux-i2c,
	devicetree, linux-pci, linux-sound, patches, linux-gpio, linux-pm,
	linux-spi, linux-acpi, linux-cxl, Allan Nielsen, Horatiu Vultur,
	Steen Hegelund, Luca Ceresoli, Thomas Petazzoni, Saravana Kannan,
	Bartosz Golaszewski

On Thu, 12 Mar 2026 at 16:27, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Tue, Mar 10, 2026 at 04:03:42PM +0100, Geert Uytterhoeven wrote:
> > Hi Hervé,
> >
> > On Fri, 27 Feb 2026 at 14:55, Herve Codina <herve.codina@bootlin.com> wrote:
> > > get_dev_from_fwnode() calls get_device() and so it acquires a reference
> > > on the device returned.
> > >
> > > In order to be more obvious that this wrapper is a get_device() variant,
> > > rename it to get_device_from_fwnode().
> > >
> > > Suggested-by: Mark Brown <broonie@kernel.org>
> > > Link: https://lore.kernel.org/lkml/CAGETcx97QjnjVR8Z5g0ndLHpK96hLd4aYSV=iEkKPNbNOccYmA@mail.gmail.com/
> > > Signed-off-by: Herve Codina <herve.codina@bootlin.com>
> > > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > Reviewed-by: Saravana Kannan <saravanak@google.com>
> > > Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
> > > Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
> >
> > FTR, one more user of get_dev_from_fwnode() appeared in commit
> > 9035073d0ef1de81 ("reset: convert reset core to using firmware nodes")
> > in reset/next.
>
> Ick, that's going to make this hard to land anywhere.  This is a rough
> series, perhaps it should be split up to make it easier somehow?
>
> thanks,
>
> greg k-h

I fully agree with the above. Renaming the function isn't necessary
for the $subject series.

I suggest we simply drop this patch from the series - and if the
renaming really makes sense in the end, we can deal with that
separately later on.

So withdrawing my ack from this one.

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v5 02/28] driver core: Rename get_dev_from_fwnode() wrapper to get_device_from_fwnode()
  2026-03-13  9:43       ` Ulf Hansson
@ 2026-03-13 11:20         ` Herve Codina
  2026-03-13 11:29           ` Andy Shevchenko
  0 siblings, 1 reply; 46+ messages in thread
From: Herve Codina @ 2026-03-13 11:20 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Greg Kroah-Hartman, Geert Uytterhoeven, Andrew Lunn, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Kalle Niemi, Matti Vaittinen,
	Rafael J. Wysocki, Danilo Krummrich, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Michael Turquette,
	Stephen Boyd, Andi Shyti, Wolfram Sang, Peter Rosin,
	Arnd Bergmann, Saravana Kannan, Bjorn Helgaas, Charles Keepax,
	Richard Fitzgerald, David Rhodes, Linus Walleij, Mark Brown,
	Len Brown, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Sakari Ailus, Davidlohr Bueso, Jonathan Cameron, Dave Jiang,
	Alison Schofield, Vishal Verma, Ira Weiny, Dan Williams,
	Shawn Guo, Wolfram Sang, linux-kernel, driver-core, imx,
	linux-arm-kernel, linux-clk, linux-i2c, devicetree, linux-pci,
	linux-sound, patches, linux-gpio, linux-pm, linux-spi, linux-acpi,
	linux-cxl, Allan Nielsen, Horatiu Vultur, Steen Hegelund,
	Luca Ceresoli, Thomas Petazzoni, Saravana Kannan,
	Bartosz Golaszewski

Hi Greg, Ulf,

On Fri, 13 Mar 2026 10:43:33 +0100
Ulf Hansson <ulf.hansson@linaro.org> wrote:

> On Thu, 12 Mar 2026 at 16:27, Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> >
> > On Tue, Mar 10, 2026 at 04:03:42PM +0100, Geert Uytterhoeven wrote:  
> > > Hi Hervé,
> > >
> > > On Fri, 27 Feb 2026 at 14:55, Herve Codina <herve.codina@bootlin.com> wrote:  
> > > > get_dev_from_fwnode() calls get_device() and so it acquires a reference
> > > > on the device returned.
> > > >
> > > > In order to be more obvious that this wrapper is a get_device() variant,
> > > > rename it to get_device_from_fwnode().
> > > >
> > > > Suggested-by: Mark Brown <broonie@kernel.org>
> > > > Link: https://lore.kernel.org/lkml/CAGETcx97QjnjVR8Z5g0ndLHpK96hLd4aYSV=iEkKPNbNOccYmA@mail.gmail.com/
> > > > Signed-off-by: Herve Codina <herve.codina@bootlin.com>
> > > > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > > Reviewed-by: Saravana Kannan <saravanak@google.com>
> > > > Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
> > > > Acked-by: Ulf Hansson <ulf.hansson@linaro.org>  
> > >
> > > FTR, one more user of get_dev_from_fwnode() appeared in commit
> > > 9035073d0ef1de81 ("reset: convert reset core to using firmware nodes")
> > > in reset/next.  
> >
> > Ick, that's going to make this hard to land anywhere.  This is a rough
> > series, perhaps it should be split up to make it easier somehow?
> >
> > thanks,
> >
> > greg k-h  
> 
> I fully agree with the above. Renaming the function isn't necessary
> for the $subject series.
> 
> I suggest we simply drop this patch from the series - and if the
> renaming really makes sense in the end, we can deal with that
> separately later on.
> 
> So withdrawing my ack from this one.
> 
> Kind regards
> Uffe

Also agree on my side. I will fully remove this function renaming part from
this series in its next iteration.

Best regards,
Hervé


^ permalink raw reply	[flat|nested] 46+ messages in thread

* Re: [PATCH v5 02/28] driver core: Rename get_dev_from_fwnode() wrapper to get_device_from_fwnode()
  2026-03-13 11:20         ` Herve Codina
@ 2026-03-13 11:29           ` Andy Shevchenko
  0 siblings, 0 replies; 46+ messages in thread
From: Andy Shevchenko @ 2026-03-13 11:29 UTC (permalink / raw)
  To: Herve Codina
  Cc: Ulf Hansson, Greg Kroah-Hartman, Geert Uytterhoeven, Andrew Lunn,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Kalle Niemi,
	Matti Vaittinen, Rafael J. Wysocki, Danilo Krummrich, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michael Turquette, Stephen Boyd, Andi Shyti, Wolfram Sang,
	Peter Rosin, Arnd Bergmann, Saravana Kannan, Bjorn Helgaas,
	Charles Keepax, Richard Fitzgerald, David Rhodes, Linus Walleij,
	Mark Brown, Len Brown, Daniel Scally, Heikki Krogerus,
	Sakari Ailus, Davidlohr Bueso, Jonathan Cameron, Dave Jiang,
	Alison Schofield, Vishal Verma, Ira Weiny, Dan Williams,
	Shawn Guo, Wolfram Sang, linux-kernel, driver-core, imx,
	linux-arm-kernel, linux-clk, linux-i2c, devicetree, linux-pci,
	linux-sound, patches, linux-gpio, linux-pm, linux-spi, linux-acpi,
	linux-cxl, Allan Nielsen, Horatiu Vultur, Steen Hegelund,
	Luca Ceresoli, Thomas Petazzoni, Saravana Kannan,
	Bartosz Golaszewski

On Fri, Mar 13, 2026 at 12:20:27PM +0100, Herve Codina wrote:
> On Fri, 13 Mar 2026 10:43:33 +0100
> Ulf Hansson <ulf.hansson@linaro.org> wrote:

...

> Also agree on my side. I will fully remove this function renaming part from
> this series in its next iteration.

Yeah, make this integration easier.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2026-03-13 11:29 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-27 13:53 [PATCH v5 00/28] lan966x pci device: Add support for SFPs Herve Codina
2026-02-27 13:53 ` [PATCH v5 01/28] Revert "treewide: Fix probing of devices in DT overlays" Herve Codina
2026-02-27 13:53 ` [PATCH v5 02/28] driver core: Rename get_dev_from_fwnode() wrapper to get_device_from_fwnode() Herve Codina
2026-03-10 15:03   ` Geert Uytterhoeven
2026-03-12 15:27     ` Greg Kroah-Hartman
2026-03-13  9:43       ` Ulf Hansson
2026-03-13 11:20         ` Herve Codina
2026-03-13 11:29           ` Andy Shevchenko
2026-02-27 13:54 ` [PATCH v5 03/28] of: dynamic: Fix overlayed devices not probing because of fw_devlink Herve Codina
2026-02-27 16:50   ` Geert Uytterhoeven
2026-03-03 14:58   ` Kalle Niemi
2026-02-27 13:54 ` [PATCH v5 04/28] driver core: Avoid warning when removing a device while its supplier is unbinding Herve Codina
2026-02-27 13:54 ` [PATCH v5 05/28] bus: simple-pm-bus: Remove child devices when the bus is unbound Herve Codina
2026-02-27 13:54 ` [PATCH v5 06/28] bus: simple-pm-bus: Populate child nodes at probe Herve Codina
2026-02-27 13:54 ` [PATCH v5 07/28] driver core: fw_devlink: Introduce fw_devlink_set_device() Herve Codina
2026-02-27 15:57   ` Charles Keepax
2026-03-02 12:23   ` Jonathan Cameron
2026-03-03 14:12     ` Herve Codina
2026-03-03 15:24       ` Andy Shevchenko
2026-02-27 13:54 ` [PATCH v5 08/28] drivers: core: Use fw_devlink_set_device() Herve Codina
2026-02-27 13:54 ` [PATCH v5 09/28] pinctrl: cs42l43: " Herve Codina
2026-02-27 14:11   ` Linus Walleij
2026-02-27 14:22     ` Herve Codina
2026-02-27 15:58   ` Charles Keepax
2026-02-27 13:54 ` [PATCH v5 10/28] cxl/test: Use device_set_node() Herve Codina
2026-03-02 12:21   ` Jonathan Cameron
2026-02-27 13:54 ` [PATCH v5 11/28] cxl/test: Use fw_devlink_set_device() Herve Codina
2026-03-02 12:24   ` Jonathan Cameron
2026-03-03 14:28     ` Herve Codina
2026-02-27 13:54 ` [PATCH v5 12/28] PCI: of: " Herve Codina
2026-02-27 13:54 ` [PATCH v5 13/28] PCI: of: Set fwnode device of newly created PCI device nodes Herve Codina
2026-02-27 13:54 ` [PATCH v5 14/28] PCI: of: Remove fwnode_dev_initialized() call for a PCI root bridge node Herve Codina
2026-02-27 13:54 ` [PATCH v5 15/28] i2c: core: Introduce i2c_get_adapter_physdev() Herve Codina
2026-02-27 13:54 ` [PATCH v5 16/28] i2c: mux: Set adapter physical device Herve Codina
2026-02-27 13:54 ` [PATCH v5 17/28] i2c: mux: Create missing devlink between mux and " Herve Codina
2026-02-27 13:54 ` [PATCH v5 18/28] of: property: Allow fw_devlink device-tree on x86 Herve Codina
2026-02-27 13:54 ` [PATCH v5 19/28] clk: lan966x: Add MCHP_LAN966X_PCI dependency Herve Codina
2026-02-27 13:54 ` [PATCH v5 20/28] i2c: busses: at91: " Herve Codina
2026-02-27 13:54 ` [PATCH v5 21/28] misc: lan966x_pci: Fix dtso nodes ordering Herve Codina
2026-02-27 13:54 ` [PATCH v5 22/28] misc: lan966x_pci: Split dtso in dtsi/dtso Herve Codina
2026-02-27 13:54 ` [PATCH v5 23/28] misc: lan966x_pci: Rename lan966x_pci.dtso to lan966x_evb_lan9662_nic.dtso Herve Codina
2026-02-27 13:54 ` [PATCH v5 24/28] PCI: Add Microchip LAN9662 PCI Device ID Herve Codina
2026-02-27 13:54 ` [PATCH v5 25/28] misc: lan966x_pci: Introduce board specific data Herve Codina
2026-02-27 13:54 ` [PATCH v5 26/28] misc: lan966x_pci: Add dtsi/dtso nodes in order to support SFPs Herve Codina
2026-02-27 13:54 ` [PATCH v5 27/28] misc: lan966x_pci: Sort the drivers list in Kconfig help Herve Codina
2026-02-27 13:54 ` [PATCH v5 28/28] misc: lan966x_pci: Add drivers needed to support SFPs " Herve Codina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox