[net-next,v3,4/4] net: dsa: mv88e6xxx: mask apparently non-existing phys during probing

Message ID 20230314182659.63686-5-klaus.kudielka@gmail.com
State New
Headers
Series net: dsa: mv88e6xxx: accelerate C45 scan |

Commit Message

Klaus Kudielka March 14, 2023, 6:26 p.m. UTC
  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@lunn.ch>
Signed-off-by: Klaus Kudielka <klaus.kudielka@gmail.com>
---
v2: Patch is new
v3: No change

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

Comments

Andrew Lunn March 14, 2023, 7:23 p.m. UTC | #1
On Tue, Mar 14, 2023 at 07:26:59PM +0100, Klaus Kudielka wrote:
> 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@lunn.ch>
> Signed-off-by: Klaus Kudielka <klaus.kudielka@gmail.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
  

Patch

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);