提交 2e1c8084 编写于 作者: M Maxim Uvarov 提交者: 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: NMax Uvarov <muvarov@gmail.com>
Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
Reviewed-by: NGrygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册