Re: [PATCH net-next v2 1/4] net: phy: Map C45 probe read errors to -ENODEV during bus scan

From: Nicolai Buchwitz

Date: Tue Nov 17 2026 - 04:33:33 EST


On 16.11.2026 22:34, Florian Fainelli wrote:
get_phy_c22_id() maps a bus read error of -EIO or -ENODEV to -ENODEV, so
that mdiobus_scan_bus_c22() carries on with the next address when nothing
answers. get_phy_c45_ids() only does so for phy_c45_probe_present(); a
failed read of the devices in package registers is turned into -EIO, which
mdiobus_scan_bus_c45() treats as fatal and which makes the whole
__mdiobus_register() fail.

MDIO controllers that report a read from an empty address as a bus error
(e.g. MDIO_READ_FAIL on the UniMAC MDIO block) and that provide read_c45()
with unmasked addresses therefore cannot be registered: the C45 scan fails
on the first empty address.

Let get_phy_c45_devs_in_pkg() return the bus error and apply the same
mapping as get_phy_c22_id() to the two places that look for a device at an
address: the loop over the MMDs and the MMD 0 fallback. Errors from the
reads of the per-MMD identifiers, which only happen once a device has
answered, are still reported as -EIO.

Signed-off-by: Florian Fainelli <florian.fainelli@xxxxxxxxxxxx>

[...]

Reviewed-by: Nicolai Buchwitz <nb@xxxxxxxxxxx>

Thanks,
Nicolai