Skip to content

Commit

Permalink
net: phy: mscc-miim: use more reasonable delays
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Alexandre Belloni <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
atenart authored and davem330 committed May 26, 2020
1 parent 90ce665 commit 9513167
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/phy/mdio-mscc-miim.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 9513167

Please sign in to comment.