From: Antoine Tenart Date: Tue, 26 May 2020 16:22:53 +0000 (+0200) Subject: net: phy: mscc-miim: use more reasonable delays X-Git-Tag: Ubuntu-5.13.0-19.19~5898^2~103^2~3 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=9513167e6c3343f4ec8e04eb89e9b130eb90e58a;p=mirror_ubuntu-jammy-kernel.git net: phy: mscc-miim: use more reasonable delays The MSCC MIIM MDIO driver uses delays to read poll a status register. I made multiple tests on a Ocelot PCS120 platform which led me to reduce those delays. The delay in between which the polling function is allowed to sleep is reduced from 100us to 50us which in almost all cases is a good value to succeed at the first retry. The overall delay is also lowered as the prior value was really way to high, 10000us is large enough. Signed-off-by: Antoine Tenart Reviewed-by: Alexandre Belloni Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller --- diff --git a/drivers/net/phy/mdio-mscc-miim.c b/drivers/net/phy/mdio-mscc-miim.c index badbc99bedd3..0b7544f593fb 100644 --- a/drivers/net/phy/mdio-mscc-miim.c +++ b/drivers/net/phy/mdio-mscc-miim.c @@ -44,7 +44,7 @@ static int mscc_miim_wait_ready(struct mii_bus *bus) u32 val; readl_poll_timeout(miim->regs + MSCC_MIIM_REG_STATUS, val, - !(val & MSCC_MIIM_STATUS_STAT_BUSY), 100, 250000); + !(val & MSCC_MIIM_STATUS_STAT_BUSY), 50, 10000); if (val & MSCC_MIIM_STATUS_STAT_BUSY) return -ETIMEDOUT;