aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek BehĂșn <[email protected]>2023-03-19 15:02:38 +0100
committerPaolo Abeni <[email protected]>2023-03-21 12:52:04 +0100
commita4926c2943dd17f84b552ba6fb754df0dc6a2fa8 (patch)
tree195bf28fdb838698b10f1db3a21eb70dd0b06d82
parenta08df15eab0c572bc1d98c2392bcfcd744f26eda (diff)
net: dsa: mv88e6xxx: fix mdio bus' phy_mask member
Commit 2c7e46edbd03 ("net: dsa: mv88e6xxx: mask apparently non-existing phys during probing") added non-trivial bus->phy_mask in mv88e6xxx_mdio_register() in order to avoid excessive mdio bus transactions during probing. But the mask is incorrect for switches with non-zero phy_base_addr (such as 88E6341). Fix this. Fixes: 2c7e46edbd03 ("net: dsa: mv88e6xxx: mask apparently non-existing phys during probing") Signed-off-by: Marek BehĂșn <[email protected]> Tested-by: Klaus Kudielka <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
-rw-r--r--drivers/net/dsa/mv88e6xxx/chip.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 260e38c5c6e6..b73d1d6747b7 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -3805,7 +3805,9 @@ static int mv88e6xxx_mdio_register(struct mv88e6xxx_chip *chip,
bus->read_c45 = mv88e6xxx_mdio_read_c45;
bus->write_c45 = mv88e6xxx_mdio_write_c45;
bus->parent = chip->dev;
- bus->phy_mask = GENMASK(31, mv88e6xxx_num_ports(chip));
+ bus->phy_mask = ~GENMASK(chip->info->phy_base_addr +
+ mv88e6xxx_num_ports(chip) - 1,
+ chip->info->phy_base_addr);
if (!external) {
err = mv88e6xxx_g2_irq_mdio_setup(chip, bus);