Commit 2e1c8084 authored by Maxim Uvarov's avatar Maxim Uvarov Committed by David S. Miller

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: default avatarMax Uvarov <muvarov@gmail.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Reviewed-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3a4487b8
...@@ -198,8 +198,10 @@ static inline int wait_for_user_access(struct davinci_mdio_data *data) ...@@ -198,8 +198,10 @@ static inline int wait_for_user_access(struct davinci_mdio_data *data)
return 0; return 0;
reg = __raw_readl(&regs->control); reg = __raw_readl(&regs->control);
if ((reg & CONTROL_IDLE) == 0) if ((reg & CONTROL_IDLE) == 0) {
usleep_range(100, 200);
continue; continue;
}
/* /*
* An emac soft_reset may have clobbered the mdio controller's * An emac soft_reset may have clobbered the mdio controller's
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment