Re: [PATCH net-next v3 2/4] net: mdio: link PHY package suppliers to member PHYs

From: Andy Shevchenko

Date: Tue Aug 18 2026 - 03:39:32 EST


On Tue, Aug 18, 2026 at 12:58:58AM -0600, James Hilliard wrote:
> Ethernet PHY package nodes describe resources shared by their member
> PHYs, but a package node is not instantiated as a device. Its
> firmware-node supplier links therefore cannot become normal device links
> for the PHY members without help from the MDIO layer.
>
> When registering an OF-backed PHY whose parent is an
> ethernet-phy-package node, copy the package supplier links onto the
> member's firmware node before the PHY device is added. The ordinary
> fw_devlink path then creates managed links after the PHY device has been
> initialized for link registration and before its driver can probe.
>
> Apply this to both ordinary OF discovery and the exported registration
> path for a pre-created PHY device. Leave the package links intact so
> every member, including one registered later, can acquire the same
> dependencies. This preserves probe, unbind and runtime-PM ordering
> without adding PHY-package policy to generic firmware parsing.

...

> #include <linux/device.h>
> #include <linux/err.h>

> +#include <linux/fwnode.h>

How is this being used?

> #include <linux/fwnode_mdio.h>
> #include <linux/kernel.h>
> #include <linux/module.h>

...

> +static int of_mdiobus_link_phy_package(struct device_node *child)
> +{
> + struct device_node *package __free(device_node) = of_get_parent(child);
> +
> + if (!package || !of_node_name_eq(package, "ethernet-phy-package"))
> + return 0;
> +
> + return fw_devlink_copy_suppliers(of_fwnode_handle(child),
> + of_fwnode_handle(package));

It could be moved to fwnode from the start. Don't we have the respective parts
already?

> +}

--
With Best Regards,
Andy Shevchenko