diff options
author | Emil Tantilov <emil.s.tantilov@intel.com> | 2011-02-15 20:38:08 -0500 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2011-03-03 06:04:05 -0500 |
commit | 48de36c5656113ce6cfe4207da2f90f46917e53d (patch) | |
tree | 7978a5577a2856684cf3c2c2119b1156e3ace916 /drivers/net/ixgbe | |
parent | 76d97dd4c44c6847029ae9021fe0d880cad90d33 (diff) |
ixgbe: Check link wants report current link state
Currently check link reports the link state as down, if at any time
the link had previously gone down since the last time the LINKS
register was read. This does not accurately reflect the function of
the check link call, which should be to return the CURRENT link
state. Code now reads the LINKS registers twice, once to clear the
previous and again to get the current value.
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ixgbe')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_common.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/net/ixgbe/ixgbe_common.c b/drivers/net/ixgbe/ixgbe_common.c index 6d87c7491d10..7e3bb559f42d 100644 --- a/drivers/net/ixgbe/ixgbe_common.c +++ b/drivers/net/ixgbe/ixgbe_common.c | |||
@@ -2769,10 +2769,19 @@ s32 ixgbe_clear_vfta_generic(struct ixgbe_hw *hw) | |||
2769 | s32 ixgbe_check_mac_link_generic(struct ixgbe_hw *hw, ixgbe_link_speed *speed, | 2769 | s32 ixgbe_check_mac_link_generic(struct ixgbe_hw *hw, ixgbe_link_speed *speed, |
2770 | bool *link_up, bool link_up_wait_to_complete) | 2770 | bool *link_up, bool link_up_wait_to_complete) |
2771 | { | 2771 | { |
2772 | u32 links_reg; | 2772 | u32 links_reg, links_orig; |
2773 | u32 i; | 2773 | u32 i; |
2774 | 2774 | ||
2775 | /* clear the old state */ | ||
2776 | links_orig = IXGBE_READ_REG(hw, IXGBE_LINKS); | ||
2777 | |||
2775 | links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS); | 2778 | links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS); |
2779 | |||
2780 | if (links_orig != links_reg) { | ||
2781 | hw_dbg(hw, "LINKS changed from %08X to %08X\n", | ||
2782 | links_orig, links_reg); | ||
2783 | } | ||
2784 | |||
2776 | if (link_up_wait_to_complete) { | 2785 | if (link_up_wait_to_complete) { |
2777 | for (i = 0; i < IXGBE_LINK_UP_TIME; i++) { | 2786 | for (i = 0; i < IXGBE_LINK_UP_TIME; i++) { |
2778 | if (links_reg & IXGBE_LINKS_UP) { | 2787 | if (links_reg & IXGBE_LINKS_UP) { |