diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2009-10-05 02:35:23 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-06 17:59:23 -0400 |
commit | ab576389b733b458495529f81839f499b3fece78 (patch) | |
tree | 3b5728e8d8536bf70e927ea4ce6d16526763518a /drivers | |
parent | 81fadd81a5bc897c8d0424d1cd90cb999d8e12b0 (diff) |
igb: add code to retry a phy read in the event of failure on link check
This patch adds a retry to phy reads in the event of failure. The original
code broke out of the loop on failure and this is a mistake as we should be
trying to do the read twice.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/igb/e1000_phy.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/igb/e1000_phy.c b/drivers/net/igb/e1000_phy.c index b27275d7ff6..5fe03e114b8 100644 --- a/drivers/net/igb/e1000_phy.c +++ b/drivers/net/igb/e1000_phy.c | |||
@@ -1444,8 +1444,14 @@ s32 igb_phy_has_link(struct e1000_hw *hw, u32 iterations, | |||
1444 | * it across the board. | 1444 | * it across the board. |
1445 | */ | 1445 | */ |
1446 | ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status); | 1446 | ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status); |
1447 | if (ret_val) | 1447 | if (ret_val) { |
1448 | break; | 1448 | /* |
1449 | * If the first read fails, another entity may have | ||
1450 | * ownership of the resources, wait and try again to | ||
1451 | * see if they have relinquished the resources yet. | ||
1452 | */ | ||
1453 | udelay(usec_interval); | ||
1454 | } | ||
1449 | ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status); | 1455 | ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status); |
1450 | if (ret_val) | 1456 | if (ret_val) |
1451 | break; | 1457 | break; |