* [PATCH net-next v2 3/3] net: dsa: mv88e6xxx: mask apparently non-existing phys during probing
@ 2023-03-11 20:37 Klaus Kudielka
0 siblings, 0 replies; 2+ messages in thread
From: Klaus Kudielka @ 2023-03-11 20:37 UTC (permalink / raw)
To: Andrew Lunn
Cc: Florian Fainelli, Vladimir Oltean, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Richard Cochran, netdev,
linux-kernel, Klaus Kudielka
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
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
^ permalink raw reply related [flat|nested] 2+ messages in thread* [PATCH net-next v2 0/3] net: dsa: mv88e6xxx: accelerate C45 scan
@ 2023-03-11 20:31 Klaus Kudielka
2023-03-11 20:31 ` [PATCH net-next v2 3/3] net: dsa: mv88e6xxx: mask apparently non-existing phys during probing Klaus Kudielka
0 siblings, 1 reply; 2+ messages in thread
From: Klaus Kudielka @ 2023-03-11 20:31 UTC (permalink / raw)
To: Andrew Lunn
Cc: Florian Fainelli, Vladimir Oltean, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Richard Cochran, netdev,
linux-kernel, Klaus Kudielka
Starting with commit 1a136ca2e089 ("net: mdio: scan bus based on bus
capabilities for C22 and C45"), mdiobus_scan_bus_c45() is being called on
buses with MDIOBUS_NO_CAP. On a Turris Omnia (Armada 385, 88E6176 switch),
this causes a significant increase of boot time, from 1.6 seconds, to 6.3
seconds. The boot time stated here is until start of /init.
Further testing revealed that the C45 scan is indeed expensive (around
2.7 seconds, due to a huge number of bus transactions), and called twice.
Two things were suggested:
(1) to move the expensive call of mv88e6xxx_mdios_register() from
mv88e6xxx_probe() to mv88e6xxx_setup().
(2) to mask apparently non-existing phys during probing.
With those two changes, boot time on the Turris Omnia is back to normal.
Patch #1 is preparatory code movement, without functional change.
The remaining two patches implement the suggestions above.
Link: https://lore.kernel.org/lkml/449bde236c08d5ab5e54abd73b645d8b29955894.camel@gmail.com/
Changes in v2:
Add cover letter
Extend the cleanup in mv88e6xxx_setup() to remove the mdio bus on failure
Add separate patch for phy masking
Klaus Kudielka (3):
net: dsa: mv88e6xxx: re-order functions
net: dsa: mv88e6xxx: move call to mv88e6xxx_mdios_register()
net: dsa: mv88e6xxx: mask apparently non-existing phys during probing
drivers/net/dsa/mv88e6xxx/chip.c | 381 ++++++++++++++++---------------
1 file changed, 192 insertions(+), 189 deletions(-)
--
2.39.2
^ permalink raw reply [flat|nested] 2+ messages in thread* [PATCH net-next v2 3/3] net: dsa: mv88e6xxx: mask apparently non-existing phys during probing
2023-03-11 20:31 [PATCH net-next v2 0/3] net: dsa: mv88e6xxx: accelerate C45 scan Klaus Kudielka
@ 2023-03-11 20:31 ` Klaus Kudielka
0 siblings, 0 replies; 2+ messages in thread
From: Klaus Kudielka @ 2023-03-11 20:31 UTC (permalink / raw)
To: Andrew Lunn
Cc: Florian Fainelli, Vladimir Oltean, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Richard Cochran, netdev,
linux-kernel, Klaus Kudielka
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
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-03-11 20:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-11 20:37 [PATCH net-next v2 3/3] net: dsa: mv88e6xxx: mask apparently non-existing phys during probing Klaus Kudielka
-- strict thread matches above, loose matches on Subject: below --
2023-03-11 20:31 [PATCH net-next v2 0/3] net: dsa: mv88e6xxx: accelerate C45 scan Klaus Kudielka
2023-03-11 20:31 ` [PATCH net-next v2 3/3] net: dsa: mv88e6xxx: mask apparently non-existing phys during probing Klaus Kudielka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox