[PATCH net-next v2 3/3] net: dsa: mv88e6xxx: mask apparently non-existing phys during probing

From: Klaus Kudielka
Date: Sat Mar 11 2023 - 15:32:37 EST


To avoid excessive mdio bus transactions during probing, mask all phy
addresses that do not exist (there is a 1:1 mapping between switch port
number and phy address).

Suggested-by: Andrew Lunn <andrew@xxxxxxx>
Signed-off-by: Klaus Kudielka <klaus.kudielka@xxxxxxxxx>
---
v2: Patch is new

drivers/net/dsa/mv88e6xxx/chip.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 29b0f3bb1c..c52798d9ce 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -3797,6 +3797,7 @@ 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));

if (!external) {
err = mv88e6xxx_g2_irq_mdio_setup(chip, bus);
--
2.39.2