public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2 1/2] drivers: net: davinci_mdio: remove busy loop on wait user access
@ 2017-08-10  7:47 Max Uvarov
  2017-08-10  7:47 ` [PATCHv2 2/2] drivers: net: davinci_mdio: print bus frequency Max Uvarov
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Max Uvarov @ 2017-08-10  7:47 UTC (permalink / raw)
  To: netdev; +Cc: linux-omap, grygorii.strashko, Max Uvarov

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>
---
 v2: fix spelling in commit description.

 drivers/net/ethernet/ti/davinci_mdio.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c
index 33df340..611e7cc 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
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-08-11 21:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-10  7:47 [PATCHv2 1/2] drivers: net: davinci_mdio: remove busy loop on wait user access Max Uvarov
2017-08-10  7:47 ` [PATCHv2 2/2] drivers: net: davinci_mdio: print bus frequency Max Uvarov
2017-08-10 16:18   ` Grygorii Strashko
2017-08-11 21:24   ` David Miller
2017-08-10 14:40 ` [PATCHv2 1/2] drivers: net: davinci_mdio: remove busy loop on wait user access Andrew Lunn
2017-08-10 16:24 ` Grygorii Strashko
2017-08-11 21:24 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox