diff --git a/drivers/net/phy/as21xx_1.9.2/as21xxx.c b/drivers/net/phy/as21xx_1.9.2/as21xxx.c index b5cf7a9c1b1a8..ed001d3a834e3 100644 --- a/drivers/net/phy/as21xx_1.9.2/as21xxx.c +++ b/drivers/net/phy/as21xx_1.9.2/as21xxx.c @@ -493,7 +493,6 @@ int aeon_cl45_read(struct phy_device *phydev, int dev_addr, mutex_lock(&bus->mdio_lock); ret = __mdiobus_c45_read(bus, phy_addr, dev_addr, phy_reg); mutex_unlock(&bus->mdio_lock); - aeon_mdio_patch(phydev); return ret; } @@ -1481,7 +1480,17 @@ static int aeon_config_led(struct phy_device *phydev) static int aeon_gen1_match_phy_device(struct phy_device *phydev, const struct phy_driver *phydrv) { - u32 phy_id = aeon_gen1_read_pid(phydev); + u32 phy_id; + + /* Skip PHYs that are not Aeonsemi. Probing every PHY on every bus + * sends vendor register accesses to foreign devices, which on a + * DSA switch relay bus become failing firmware mailbox commands. + */ + if (!phy_id_compare_vendor(phydev->c45_ids.device_ids[MDIO_MMD_PCS], + PHY_VENDOR_AEONSEMI)) + return genphy_match_phy_device(phydev, phydrv); + + phy_id = aeon_gen1_read_pid(phydev); if (phy_id != PHY_ID_AS21XXX) return 0; @@ -1495,6 +1504,11 @@ static int aeon_gen1_match_phy_device(struct phy_device *phydev, static int aeon_gen2_match_phy_device(struct phy_device *phydev, const struct phy_driver *phydrv) { + /* Skip PHYs that are not Aeonsemi - see aeon_gen1_match_phy_device(). */ + if (!phy_id_compare_vendor(phydev->c45_ids.device_ids[MDIO_MMD_PCS], + PHY_VENDOR_AEONSEMI)) + return genphy_match_phy_device(phydev, phydrv); + /* AEONSEMI get pid. */ phydev->phy_id = aeon_gen2_read_pid(phydev);