summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/ti/davinci_mdio.c
diff options
context:
space:
mode:
authorMaxim Uvarov <muvarov@gmail.com>2017-08-10 10:47:46 +0300
committerDavid S. Miller <davem@davemloft.net>2017-08-12 00:23:59 +0300
commit2e1c80847b9983a8c93a678f6de2dc3c42f19661 (patch)
treec48837e059647422f9c99b320abda09d5b9f376e /drivers/net/ethernet/ti/davinci_mdio.c
parent3a4487b88f9a4deaded65fed60135b06298b7990 (diff)
downloadlinux-2e1c80847b9983a8c93a678f6de2dc3c42f19661.tar.xz
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>
Diffstat (limited to 'drivers/net/ethernet/ti/davinci_mdio.c')
-rw-r--r--drivers/net/ethernet/ti/davinci_mdio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c
index 33df340db1f1..611e7cc5f07b 100644
--- a/drivers/net/ethernet/ti/davinci_mdio.c
+++ b/drivers/net/ethernet/ti/davinci_mdio.c
@@ -198,8 +198,10 @@ static inline int wait_for_user_access(struct davinci_mdio_data *data)
return 0;
reg = __raw_readl(&regs->control);
- if ((reg & CONTROL_IDLE) == 0)
+ if ((reg & CONTROL_IDLE) == 0) {
+ usleep_range(100, 200);
continue;
+ }
/*
* An emac soft_reset may have clobbered the mdio controller's