Commit 21d882eb authored by Emil Tantilov's avatar Emil Tantilov Committed by Jeff Kirsher

ixgbe: fix link status check for copper X550em

Read the PHY register twice in order to get the correct value for
autoneg_status.
Signed-off-by: default avatarEmil Tantilov <emil.s.tantilov@intel.com>
Tested-by: default avatarKrishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 4dc4000b
...@@ -1556,7 +1556,7 @@ static s32 ixgbe_check_link_t_X550em(struct ixgbe_hw *hw, ...@@ -1556,7 +1556,7 @@ static s32 ixgbe_check_link_t_X550em(struct ixgbe_hw *hw,
bool link_up_wait_to_complete) bool link_up_wait_to_complete)
{ {
u32 status; u32 status;
u16 autoneg_status; u16 i, autoneg_status;
if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper) if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper)
return IXGBE_ERR_CONFIG; return IXGBE_ERR_CONFIG;
...@@ -1568,13 +1568,18 @@ static s32 ixgbe_check_link_t_X550em(struct ixgbe_hw *hw, ...@@ -1568,13 +1568,18 @@ static s32 ixgbe_check_link_t_X550em(struct ixgbe_hw *hw,
if (status || !(*link_up)) if (status || !(*link_up))
return status; return status;
/* MAC link is up, so check external PHY link. /* MAC link is up, so check external PHY link.
* Read this twice back to back to indicate current status. * Link status is latching low, and can only be used to detect link
*/ * drop, and not the current status of the link without performing
status = hw->phy.ops.read_reg(hw, MDIO_STAT1, MDIO_MMD_AN, * back-to-back reads.
&autoneg_status); */
if (status) for (i = 0; i < 2; i++) {
return status; status = hw->phy.ops.read_reg(hw, MDIO_STAT1, MDIO_MMD_AN,
&autoneg_status);
if (status)
return status;
}
/* If external PHY link is not up, then indicate link not up */ /* If external PHY link is not up, then indicate link not up */
if (!(autoneg_status & IXGBE_MDIO_AUTO_NEG_LINK_STATUS)) if (!(autoneg_status & IXGBE_MDIO_AUTO_NEG_LINK_STATUS))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment