Re: PHY issue with SJA1105Q/DP84849I Design

From: Andrew Lunn
Date: Tue Dec 26 2023 - 12:00:31 EST


> The code which should have prevented this from happening is in
> phy_attach_direct():
>
> if (phydev->attached_dev) {
> dev_err(&dev->dev, "PHY already attached\n");
> err = -EBUSY;
> goto error;
> }

The problem might be dsa_shared_port_phylink_register():

err = phylink_of_phy_connect(dp->pl, port_dn, 0);
if (err && err != -ENODEV) {
pr_err("could not attach to PHY: %d\n", err);
goto err_phy_connect;
}

return 0;

Since it is not -ENODEV, it just keep going.

Andrew