Thread View: linux.kernel.netdev
3 messages
3 total messages
Started by Blake Alexander via B4 Relay
Thu, 19 Nov 2026 10:50
[PATCH net] net: dsa: mv88e6xxx: do not override PHYIDs on external MDIO
Author: Blake Alexander via B4 Relay
Date: Thu, 19 Nov 2026 10:50
Date: Thu, 19 Nov 2026 10:50
60 lines
13255 bytes
13255 bytes
From: Blake Alexander <blake.alexander@airbus.com>
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.
This was observed on a development board during the bring-up phase. The
board included an MV88E6393X with external AQR115 PHYs. The MDIO bus of
the PHYs was connected to the external MDIO bus of the Marvell switch.
Prior to applying this patch, the aquantia driver failed to detect the
AQR115 and instead detected a generic C22 device (as a PHYID of
0x00000393 does not match a known PHY). After applying this fix, the
external AQR115s were detected correctly and their respective driver
bound to them successfully.
Do not modify the returned PHYID in mv88e6xxx_mdio_read() when reading
from a device on the external MDIO bus.
Fixes: da9f33018e2c ("net: dsa: mv88e6xxx: Workaround missing PHY ID on mv88e6390")
Cc: stable@vger.kernel.org
Signed-off-by: Blake Alexander <blake.alexander@airbus.com>
---
drivers/net/dsa/mv88e6xxx/chip.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 46aef6dfe77e..bf077e476fd1 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -3779,7 +3779,7 @@ static int mv88e6xxx_mdio_read(struct mii_bus *bus, int phy, int reg)
mv88e6xxx_reg_unlock(chip);
/* Some internal PHYs don't have a model number. */
- if (reg == MII_PHYSID2 && !(val & 0x3f0) &&
+ if (!mdio_bus->external && reg == MII_PHYSID2 && !(val & 0x3f0) &&
chip->info->family < ARRAY_SIZE(family_prod_id_table)) {
prod_id = family_prod_id_table[chip->info->family];
if (prod_id)
---
base-commit: af6f95c3300e3d234c813b80f831dd7b80b3eaf2
change-id: 20261110-mv88e6xxx-fix-f29e7214897e
Best regards,
--
Blake Alexander <blake.alexander@airbus.com>
Re: [PATCH net] net: dsa: mv88e6xxx: do not override PHYIDs on external MDIO
Author: Andrew Lunn
Date: Thu, 19 Nov 2026 15:19
Date: Thu, 19 Nov 2026 15:19
37 lines
10082 bytes
10082 bytes
On Thu, Nov 19, 2026 at 11:50:00AM +0100, Blake Alexander via B4 Relay wrote:
> From: Blake Alexander <blake.alexander@airbus.com>
>
> 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@vger.kernel.org
> Signed-off-by: Blake Alexander <blake.alexander@airbus.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
Re: [PATCH net] net: dsa: mv88e6xxx: do not override PHYIDs on external MDIO
Author: patchwork-bot+netdevbpf
Date: Mon, 23 Nov 2026 15:40
Date: Mon, 23 Nov 2026 15:40
27 lines
8883 bytes
8883 bytes
Hello:
This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Thu, 19 Nov 2026 11:50:00 +0100 you wrote:
> From: Blake Alexander <blake.alexander@airbus.com>
>
> 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.
>
> [...]
Here is the summary with links:
- [net] net: dsa: mv88e6xxx: do not override PHYIDs on external MDIO
https://git.kernel.org/netdev/net/c/dd206ec7ed36
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads