Re: [PATCH 2/2] net: dsa: mv88e6xxx: move call to mv88e6xxx_mdios_register()

From: Vladimir Oltean
Date: Sat Mar 11 2023 - 13:06:58 EST


On Sat, Mar 11, 2023 at 10:41:41AM +0100, Klaus Kudielka wrote:
> From commit 1a136ca2e089 ("net: mdio: scan bus based on bus capabilities
> for C22 and C45") onwards, 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.
>
> It was suggested, to call mv88e6xxx_mdios_register() at the beginning of
> mv88e6xxx_setup(), and mv88e6xxx_mdios_unregister() at the end of
> mv88e6xxx_teardown(). This is accomplished by this patch.
>
> Testing on the Turris Omnia revealed, that this improves the situation.
> Now mdiobus_scan_bus_c45() is called only once, ending up in a boot time
> of 4.3 seconds.
>
> Link: https://lore.kernel.org/lkml/449bde236c08d5ab5e54abd73b645d8b29955894.camel@xxxxxxxxx/
> Suggested-by: Andrew Lunn <andrew@xxxxxxx>
> Tested-by: Klaus Kudielka <klaus.kudielka@xxxxxxxxx>
> Signed-off-by: Klaus Kudielka <klaus.kudielka@xxxxxxxxx>
> ---

No objection to the change. However you might want to bundle it up with
another patch for the phy_mask restriction, and resend the series using
Andrew's indications.