ixgbe: Fix check for ixgbe_phy_x550em_ext_t reset
authorTony Nguyen <anthony.l.nguyen@intel.com>
Mon, 31 Oct 2016 19:11:58 +0000 (12:11 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 3 Jan 2017 21:03:34 +0000 (13:03 -0800)
The generic PHY reset check we had previously is not sufficient for the
ixgbe_phy_x550em_ext_t PHY type.  Check 1.CC02.0 instead - same as
ixgbe_init_ext_t_x550().

Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c

index 3b8362085f57b15dba5b9ff5e8c61bf41bec3713..b2729386320484c1d31bd9562ba57318f3d3df72 100644 (file)
@@ -452,10 +452,27 @@ s32 ixgbe_reset_phy_generic(struct ixgbe_hw *hw)
         */
        for (i = 0; i < 30; i++) {
                msleep(100);
-               hw->phy.ops.read_reg(hw, MDIO_CTRL1, MDIO_MMD_PHYXS, &ctrl);
-               if (!(ctrl & MDIO_CTRL1_RESET)) {
-                       udelay(2);
-                       break;
+               if (hw->phy.type == ixgbe_phy_x550em_ext_t) {
+                       status = hw->phy.ops.read_reg(hw,
+                                                 IXGBE_MDIO_TX_VENDOR_ALARMS_3,
+                                                 MDIO_MMD_PMAPMD, &ctrl);
+                       if (status)
+                               return status;
+
+                       if (ctrl & IXGBE_MDIO_TX_VENDOR_ALARMS_3_RST_MASK) {
+                               udelay(2);
+                               break;
+                       }
+               } else {
+                       status = hw->phy.ops.read_reg(hw, MDIO_CTRL1,
+                                                     MDIO_MMD_PHYXS, &ctrl);
+                       if (status)
+                               return status;
+
+                       if (!(ctrl & MDIO_CTRL1_RESET)) {
+                               udelay(2);
+                               break;
+                       }
                }
        }