mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] bus: fsl-mc: drop the fwnode links of the dpmacs nodes
@ 2026-09-28 13:52 Vincent Jardin via B4 Relay
  2026-09-29 14:18 ` Ioana Ciornei
  2026-09-30 20:00 ` Christophe Leroy (CS GROUP)
  0 siblings, 2 replies; 3+ messages in thread
From: Vincent Jardin via B4 Relay @ 2026-09-28 13:52 UTC (permalink / raw)
  To: Ioana Ciornei
  Cc: linuxppc-dev, linux-kernel, Christophe Leroy (CS GROUP), Vincent Jardin

From: Vincent Jardin <vjardin@free.fr>

A DPMAC node under dpmacs/ is never the fwnode of any device:
  the fsl-mc bus creates dpmac.N objects without one,
  then dpaa2-mac finds its node in dpmacs/ at connect time.

fw_devlink therefore attaches the supplier links of those nodes (phys, ...)
to the nearest ancestor device, the fsl-mc bus, as SYNC_STATE_ONLY proxies.

device_link_add() refuses such a link once the consumer has probed, and
fw_devlink logs the refusal as an error.

On an LX2160A board with 4x25G DPMACs for which phys = <&serdes_1 N>,
the Serdes PHY binds after the bus and then at every boot it shows:

  fsl_mc_bus 80c000000.fsl-mc: Failed to create device link (0x180) with supplier 1ea0000.phy for /soc/fsl-mc@80c000000/dpmacs/ethernet@3

once per port!

Signed-off-by: Vincent Jardin <vjardin@free.fr>
---
 drivers/bus/fsl-mc/fsl-mc-bus.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bus.c
index 5878eafd8d44..0c37b6780c84 100644
--- a/drivers/bus/fsl-mc/fsl-mc-bus.c
+++ b/drivers/bus/fsl-mc/fsl-mc-bus.c
@@ -11,6 +11,7 @@
 #define pr_fmt(fmt) "fsl-mc: " fmt
 
 #include <linux/module.h>
+#include <linux/fwnode.h>
 #include <linux/of_device.h>
 #include <linux/of_address.h>
 #include <linux/ioport.h>
@@ -1033,6 +1034,20 @@ static int fsl_mc_firmware_check(struct platform_device *pdev)
 	return 0;
 }
 
+static void fsl_mc_purge_dpmac_fwnode_links(struct device *dev)
+{
+	struct device_node *dpmacs, *child;
+
+	dpmacs = of_get_child_by_name(dev->of_node, "dpmacs");
+	if (!dpmacs)
+		return;
+
+	for_each_child_of_node(dpmacs, child)
+		fwnode_links_purge(of_fwnode_handle(child));
+
+	of_node_put(dpmacs);
+}
+
 /*
  * fsl_mc_bus_probe - callback invoked when the root MC bus is being
  * added
@@ -1134,6 +1149,8 @@ static int fsl_mc_bus_probe(struct platform_device *pdev)
 						&mc->num_translation_ranges);
 		if (error < 0)
 			goto error_cleanup_mc_io;
+
+		fsl_mc_purge_dpmac_fwnode_links(&pdev->dev);
 	}
 
 	error = dprc_get_container_id(mc_io, 0, &container_id);

---
base-commit: 7b3b0598c00e67f2df85d0b4cd99eaa3be6c9bfd
change-id: 20260928-for-upstream-fsl-mc-dpmac-fwnode-links-622b8eadb98a

Best regards,
-- 
Vincent Jardin <vjardin@free.fr>



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

* Re: [PATCH] bus: fsl-mc: drop the fwnode links of the dpmacs nodes
  2026-09-28 13:52 [PATCH] bus: fsl-mc: drop the fwnode links of the dpmacs nodes Vincent Jardin via B4 Relay
@ 2026-09-29 14:18 ` Ioana Ciornei
  2026-09-30 20:00 ` Christophe Leroy (CS GROUP)
  1 sibling, 0 replies; 3+ messages in thread
From: Ioana Ciornei @ 2026-09-29 14:18 UTC (permalink / raw)
  To: vjardin; +Cc: linuxppc-dev, linux-kernel, Christophe Leroy (CS GROUP)

On Mon, Sep 28, 2026 at 03:52:07PM +0200, Vincent Jardin via B4 Relay wrote:
> From: Vincent Jardin <vjardin@free.fr>
> 
> A DPMAC node under dpmacs/ is never the fwnode of any device:
>   the fsl-mc bus creates dpmac.N objects without one,
>   then dpaa2-mac finds its node in dpmacs/ at connect time.
> 
> fw_devlink therefore attaches the supplier links of those nodes (phys, ...)
> to the nearest ancestor device, the fsl-mc bus, as SYNC_STATE_ONLY proxies.
> 
> device_link_add() refuses such a link once the consumer has probed, and
> fw_devlink logs the refusal as an error.
> 
> On an LX2160A board with 4x25G DPMACs for which phys = <&serdes_1 N>,
> the Serdes PHY binds after the bus and then at every boot it shows:
> 
>   fsl_mc_bus 80c000000.fsl-mc: Failed to create device link (0x180) with supplier 1ea0000.phy for /soc/fsl-mc@80c000000/dpmacs/ethernet@3
> 
> once per port!
> 
> Signed-off-by: Vincent Jardin <vjardin@free.fr>

Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Tested-by: Ioana Ciornei <ioana.ciornei@nxp.com> # LX2160ARDB

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

* Re: [PATCH] bus: fsl-mc: drop the fwnode links of the dpmacs nodes
  2026-09-28 13:52 [PATCH] bus: fsl-mc: drop the fwnode links of the dpmacs nodes Vincent Jardin via B4 Relay
  2026-09-29 14:18 ` Ioana Ciornei
@ 2026-09-30 20:00 ` Christophe Leroy (CS GROUP)
  1 sibling, 0 replies; 3+ messages in thread
From: Christophe Leroy (CS GROUP) @ 2026-09-30 20:00 UTC (permalink / raw)
  To: vjardin, Ioana Ciornei; +Cc: linuxppc-dev, linux-kernel



Le 28/09/2026 à 15:52, Vincent Jardin via B4 Relay a écrit :
> From: Vincent Jardin <vjardin@free.fr>
> 
> A DPMAC node under dpmacs/ is never the fwnode of any device:
>    the fsl-mc bus creates dpmac.N objects without one,
>    then dpaa2-mac finds its node in dpmacs/ at connect time.
> 
> fw_devlink therefore attaches the supplier links of those nodes (phys, ...)
> to the nearest ancestor device, the fsl-mc bus, as SYNC_STATE_ONLY proxies.
> 
> device_link_add() refuses such a link once the consumer has probed, and
> fw_devlink logs the refusal as an error.
> 
> On an LX2160A board with 4x25G DPMACs for which phys = <&serdes_1 N>,
> the Serdes PHY binds after the bus and then at every boot it shows:
> 
>    fsl_mc_bus 80c000000.fsl-mc: Failed to create device link (0x180) with supplier 1ea0000.phy for /soc/fsl-mc@80c000000/dpmacs/ethernet@3
> 
> once per port!

If I understand correctly this explains the problem but it doesn't 
explain what this patch does to fix it, allthough the patch subject 
might be the explanation.

I have taken this patch as is to give it a go into linux-next, but 
please feel free to send a new version with a more obvious explanation 
before begining of next week.

Another question below.

> 
> Signed-off-by: Vincent Jardin <vjardin@free.fr>
> ---
>   drivers/bus/fsl-mc/fsl-mc-bus.c | 17 +++++++++++++++++
>   1 file changed, 17 insertions(+)
> 
> diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bus.c
> index 5878eafd8d44..0c37b6780c84 100644
> --- a/drivers/bus/fsl-mc/fsl-mc-bus.c
> +++ b/drivers/bus/fsl-mc/fsl-mc-bus.c
> @@ -11,6 +11,7 @@
>   #define pr_fmt(fmt) "fsl-mc: " fmt
>   
>   #include <linux/module.h>
> +#include <linux/fwnode.h>
>   #include <linux/of_device.h>
>   #include <linux/of_address.h>
>   #include <linux/ioport.h>
> @@ -1033,6 +1034,20 @@ static int fsl_mc_firmware_check(struct platform_device *pdev)
>   	return 0;
>   }
>   
> +static void fsl_mc_purge_dpmac_fwnode_links(struct device *dev)
> +{
> +	struct device_node *dpmacs, *child;
> +
> +	dpmacs = of_get_child_by_name(dev->of_node, "dpmacs");

Is this name a valid API documented in Documentation/devicetree/bindings/ ?

I'm asking because I have already been challenged by devicetree 
reviewers on a use of undocumentated name.

Christophe

> +	if (!dpmacs)
> +		return;
> +
> +	for_each_child_of_node(dpmacs, child)
> +		fwnode_links_purge(of_fwnode_handle(child));
> +
> +	of_node_put(dpmacs);
> +}
> +
>   /*
>    * fsl_mc_bus_probe - callback invoked when the root MC bus is being
>    * added
> @@ -1134,6 +1149,8 @@ static int fsl_mc_bus_probe(struct platform_device *pdev)
>   						&mc->num_translation_ranges);
>   		if (error < 0)
>   			goto error_cleanup_mc_io;
> +
> +		fsl_mc_purge_dpmac_fwnode_links(&pdev->dev);
>   	}
>   
>   	error = dprc_get_container_id(mc_io, 0, &container_id);
> 
> ---
> base-commit: 7b3b0598c00e67f2df85d0b4cd99eaa3be6c9bfd
> change-id: 20260928-for-upstream-fsl-mc-dpmac-fwnode-links-622b8eadb98a
> 
> Best regards,


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

end of thread, other threads:[~2026-09-30 18:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-28 13:52 [PATCH] bus: fsl-mc: drop the fwnode links of the dpmacs nodes Vincent Jardin via B4 Relay
2026-09-29 14:18 ` Ioana Ciornei
2026-09-30 20:00 ` Christophe Leroy (CS GROUP)

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

all inboxes | Powered by JetHome®