From: Steve Glendinning <steve.glendinning@smsc.com>
To: netdev@vger.kernel.org
Subject: [PATCH 4/6] smsc95xx: sleep before read for lengthy operations
Date: Wed, 10 Mar 2010 18:32:37 +0000 [thread overview]
Message-ID: <1268245959-13861-5-git-send-email-steve.glendinning@smsc.com> (raw)
In-Reply-To: <1268245959-13861-4-git-send-email-steve.glendinning@smsc.com>
During init, the device reset is unexpected to complete immediately,
so sleep before testing the condition rather than after it.
Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
---
drivers/net/usb/smsc95xx.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index a55dc27..56fe73d 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -768,12 +768,12 @@ static int smsc95xx_reset(struct usbnet *dev)
timeout = 0;
do {
+ msleep(10);
ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf);
if (ret < 0) {
netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret);
return ret;
}
- msleep(10);
timeout++;
} while ((read_buf & HW_CFG_LRST_) && (timeout < 100));
@@ -791,12 +791,12 @@ static int smsc95xx_reset(struct usbnet *dev)
timeout = 0;
do {
+ msleep(10);
ret = smsc95xx_read_reg(dev, PM_CTRL, &read_buf);
if (ret < 0) {
netdev_warn(dev->net, "Failed to read PM_CTRL: %d\n", ret);
return ret;
}
- msleep(10);
timeout++;
} while ((read_buf & PM_CTL_PHY_RST_) && (timeout < 100));
--
1.6.6.1
next prev parent reply other threads:[~2010-03-10 18:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-10 18:32 [PATCH 0/6] smsc95xx: minor fixes and tidy-ups Steve Glendinning
2010-03-10 18:32 ` [PATCH 1/6] smsc95xx: change hard_header_len to include csum offload bytes Steve Glendinning
2010-03-10 18:32 ` [PATCH 2/6] smsc95xx: wait for PHY to complete reset during init Steve Glendinning
2010-03-10 18:32 ` [PATCH 3/6] smsc95xx: add constant definition for SMSC USB vendor id Steve Glendinning
2010-03-10 18:32 ` Steve Glendinning [this message]
2010-03-10 18:32 ` [PATCH 5/6] smsc95xx: check return code from control messages Steve Glendinning
2010-03-10 18:32 ` [PATCH 6/6] smsc95xx: remove unnecessary variables Steve Glendinning
2010-03-12 13:32 ` [PATCH 5/6] smsc95xx: check return code from control messages Steve.Glendinning
2010-03-15 22:39 ` [PATCH 3/6] smsc95xx: add constant definition for SMSC USB vendor id David Miller
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=1268245959-13861-5-git-send-email-steve.glendinning@smsc.com \
--to=steve.glendinning@smsc.com \
--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;
as well as URLs for NNTP newsgroup(s).