Re: [PATCH] net: phy: avoid config_init failure on unattached PHY during resume
From: yicongsrfy
Date: Sun Sep 21 2025 - 21:57:51 EST
On Fri, 19 Sep 2025 14:45:12 +0200, Andrew Lunn <andrew@xxxxxxx> wrote:
>
> > 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.
Thank you for your reply!
Disabling the broadcast address from ACPI or DTS is indeed a good
approach. However, should we also consider upgrade support for
existing devices? After all, modifying ACPI or DTS for already-deployed
devices is not a simple task. In cases like this, do we need to focus
solely on solutions implemented within the driver?