public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, gospo@redhat.com,
	Bruce Allan <bruce.w.allan@intel.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-2.6 PATCH 5/6] e1000e: delay second read of PHY_STATUS register on failure of first read
Date: Wed, 01 Jul 2009 16:28:50 -0700	[thread overview]
Message-ID: <20090701232850.20555.69711.stgit@localhost.localdomain> (raw)
In-Reply-To: <20090701232731.20555.63487.stgit@localhost.localdomain>

From: Bruce Allan <bruce.w.allan@intel.com>

Some PHYs may require two reads of the PHY_STATUS register to determine the
link status.  If the PHY is being accessed by another thread it is possible
the first read could timeout and fail.  In this case, put a delay in so
the second read will pick up the correct link status.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/e1000e/phy.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
index d845394..994401f 100644
--- a/drivers/net/e1000e/phy.c
+++ b/drivers/net/e1000e/phy.c
@@ -1531,7 +1531,12 @@ s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
 		 */
 		ret_val = e1e_rphy(hw, PHY_STATUS, &phy_status);
 		if (ret_val)
-			break;
+			/*
+			 * If the first read fails, another entity may have
+			 * ownership of the resources, wait and try again to
+			 * see if they have relinquished the resources yet.
+			 */
+			udelay(usec_interval);
 		ret_val = e1e_rphy(hw, PHY_STATUS, &phy_status);
 		if (ret_val)
 			break;


  parent reply	other threads:[~2009-07-01 23:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-01 23:27 [net-2.6 PATCH 1/6] e1000e: PHY loopback broken on 82578 Jeff Kirsher
2009-07-01 23:27 ` [net-2.6 PATCH 2/6] e1000e: delay after LCD reset and proper checks for PHY configuration done Jeff Kirsher
2009-07-01 23:28 ` [net-2.6 PATCH 3/6] e1000e: do not write SmartSpeed register bits on parts without support Jeff Kirsher
2009-07-01 23:28 ` [net-2.6 PATCH 4/6] e1000e: prevent NVM corruption on sectors larger than 4K Jeff Kirsher
2009-07-01 23:28 ` Jeff Kirsher [this message]
2009-07-01 23:29 ` [net-2.6 PATCH 6/6] e1000e: disable K1 at 1000Mbps for 82577/82578 Jeff Kirsher
2009-07-04  3:14 ` [net-2.6 PATCH 1/6] e1000e: PHY loopback broken on 82578 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=20090701232850.20555.69711.stgit@localhost.localdomain \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=bruce.w.allan@intel.com \
    --cc=davem@davemloft.net \
    --cc=gospo@redhat.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