[PATCH net-next v2 0/4] of: mdio: fix fw_devlink for Ethernet PHY packages

From: James Hilliard

Date: Sun Aug 16 2026 - 20:00:47 EST


Ethernet PHY package nodes describe resources shared by their member
PHYs, but the package node is a container rather than a struct device.
fw_devlink therefore represents those dependencies with temporary
sync-state-only links from the closest existing ancestor device to each
supplier.

For OF MDIO, that ancestor is the MDIO bus class device. The bus is
driverless, so its proxy links never reach the usual driver-bound
cleanup. They can remain after all member PHYs have probed and
indefinitely prevent suppliers from receiving sync_state().

Before fixing the proxy-link lifecycle, skip supplier links when a binding
cannot resolve its consumer node. This prevents malformed graph descriptions
from passing a NULL consumer to the fwnode-link core.

Fix both parts of the lifecycle. First, factor the sync-state-only
cleanup already performed by device_links_driver_bound() and expose it
to frameworks which populate children below driverless devices. Next,
treat each enabled member PHY as a consumer of suppliers referenced by
its package node. Finally, call the cleanup helper after successful OF
MDIO population. The real links from each member PHY retain dependency
and runtime-PM ordering.

This was found while validating an X-Powers AC300 package whose input
clock is supplied by PWM. Before the fix, the PWM driver reported that
sync_state() was pending due to stmmac-0 even after the PHY had probed.

The complete fix was tested on an Allwinner H616 board with an X-Powers
AC300 PHY package. All five real supplier links targeted the member PHY,
and no proxy link remained on the driverless MDIO bus. The PWM supplier
reached state_synced while continuing to generate the PHY clock. The PHY
negotiated a 100 Mbps full-duplex link, 8 MiB was transferred in each
direction, and 100 consecutive pings completed without loss.

Validation completed with:

- arm64 defconfig object builds of driver core, OF property and OF MDIO
with W=1;
- strict per-patch checkpatch checks; and
- the H616/AC300 hardware test described above.

Assisted-by: Codex:gpt-5.6-sol
Signed-off-by: James Hilliard <james.hilliard1@xxxxxxxxx>
---
Changes in v2:
- Add a preparatory guard for malformed graph consumers (reported by Sashiko)
- Rebase on net-next/main
- Link to v1: https://patch.msgid.link/20260814-submit-phy-package-fwdevlink-v1-v1-0-2319844f057a@xxxxxxxxx

---
James Hilliard (4):
of: property: skip links without a consumer node
driver core: factor sync-state-only link cleanup
of: property: link PHY package suppliers to member PHYs
net: mdio: release fw_devlink proxies after population

drivers/base/core.c | 74 +++++++++++++++++++++++++++++++++++-----------
drivers/net/mdio/of_mdio.c | 5 +++-
drivers/of/property.c | 18 ++++++++++-
include/linux/device.h | 1 +
4 files changed, 79 insertions(+), 19 deletions(-)
---
base-commit: e6a5d573d24cd375e09d24f136523cb3cc85c9d3
change-id: 20260814-submit-phy-package-fwdevlink-v1-76a8f9efe539

Best regards,
--
James Hilliard <james.hilliard1@xxxxxxxxx>