From: Max Uvarov <muvarov@gmail.com>
To: netdev@vger.kernel.org
Cc: linux-omap@vger.kernel.org, grygorii.strashko@ti.com,
Max Uvarov <muvarov@gmail.com>
Subject: [PATCH 1/2] drivers: net: davinci_mdio: remove busy loop on wait user access
Date: Thu, 10 Aug 2017 10:41:59 +0300 [thread overview]
Message-ID: <1502350920-22750-1-git-send-email-muvarov@gmail.com> (raw)
Polling 14 mdio devices on single mdio bus eats 30% of 1Ghz cpu time
due to busy loop in waiti(). Aadd small delay to relax cpu.
Signed-off-by: Max Uvarov <muvarov@gmail.com>
---
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(®s->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
next reply other threads:[~2017-08-10 7:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-10 7:41 Max Uvarov [this message]
2017-08-10 7:42 ` [PATCH 2/2] drivers: net: davinci_mdio: print bus frequency Max Uvarov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1502350920-22750-1-git-send-email-muvarov@gmail.com \
--to=muvarov@gmail.com \
--cc=grygorii.strashko@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox