Re: [PATCH net] net: dsa: mv88e6xxx: do not override PHYIDs on external MDIO

From: Andrew Lunn

Date: Thu Nov 19 2026 - 10:20:11 EST


On Thu, Nov 19, 2026 at 11:50:00AM +0100, Blake Alexander via B4 Relay wrote:
> From: Blake Alexander <blake.alexander@xxxxxxxxxx>
>
> Some variants of the Marvell 88E6xxx family (such as MV88E6390) support
> an external MDIO bus (in addition to the internal MDIO bus for
> configuring internal PHYs). A typical use-case for the external bus is
> to configure PHYs that are external to the switch. On switches that do
> not assign a PHYID for internal PHYs (i.e. the value is 0), the
> mv88e6xxx_mdio_read() function traps read calls to the PHYID registers
> and sets the PHYID equal to the family ID of the switch.
>
> The mv88e6xxx_mdio_read() function is reused for both internal and mdio
> bus operations. The PHYID overwrite trap does not check whether the MDIO
> bus is internal or external and wrongly modifies the PHYID of devices on
> the external bus when their PHYID2 register reports a value of 0. When a
> C22 device reports a PHYID of 0, get_phy_device() will reprobe the
> device as C45 and if successful create a C45 device. Overriding the
> PHYID in this case will prevent a C45 device (such as Aquantia AQR115)
> from being reprobed and their driver will fail to bind.

Ah, my bad. I added this code. I did not think an external PHY would
return 0. But at that time, C22 PHYs dominated.

> This was observed on a development board during the bring-up phase. The
> board included an MV88E6393X with external AQR115 PHYs.

We probably have not seen this before because most Marvell switches
are paired with Marvell PHYs.

> Fixes: da9f33018e2c ("net: dsa: mv88e6xxx: Workaround missing PHY ID on mv88e6390")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Blake Alexander <blake.alexander@xxxxxxxxxx>

Reviewed-by: Andrew Lunn <andrew@xxxxxxx>

Andrew