Re: [PATCH] net: phy: avoid config_init failure on unattached PHY during resume

From: Andrew Lunn

Date: Fri Sep 19 2025 - 08:45:27 EST


> Since this issue cannot be fundamentally resolved within phylib,
> we need to seek a solution within the PHY driver itself.

How about this...

Allow a node in DT which looks like this:

mdio {
phy@0 {
# Broadcast address, ignore
compatible = "ethernet-phy-idffff.ffff";
reg = <0>;
}

phy@16 {
# The real address of the PHY
reg = <16>;
}
}

The idea being, you can use a compatible to correct the ID of a PHY.
The ID of mostly F is considered to mean there is no PHY there, its
just the pull-up resistor on the data line. So the PHY is returning
the wrong ID...

of_mdiobus_child_is_phy() then needs to change from a bool to an int,
and return -ENODEV for "ethernet-phy-idffff.ffff", and the caller
needs to correctly handle that and not create the device.

I would also suggest the PHY driver disables the broadcast address
when it gets probed on its real address.

Andrew