Skip to content

Commit 2e1c808

Browse files
muvarovdavem330
authored andcommitted
drivers: net: davinci_mdio: remove busy loop on wait user access
Polling 14 mdio devices on single mdio bus eats 30% of 1Ghz cpu time due to busy loop in wait(). Add small delay to relax cpu. Signed-off-by: Max Uvarov <muvarov@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 3a4487b commit 2e1c808

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/net/ethernet/ti/davinci_mdio.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,10 @@ static inline int wait_for_user_access(struct davinci_mdio_data *data)
198198
return 0;
199199

200200
reg = __raw_readl(&regs->control);
201-
if ((reg & CONTROL_IDLE) == 0)
201+
if ((reg & CONTROL_IDLE) == 0) {
202+
usleep_range(100, 200);
202203
continue;
204+
}
203205

204206
/*
205207
* An emac soft_reset may have clobbered the mdio controller's

0 commit comments

Comments
 (0)