net/ixgbe/base: fix PHY reset check for x550em-ext
authorWei Dai <wei.dai@intel.com>
Wed, 21 Dec 2016 09:47:45 +0000 (17:47 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 17 Jan 2017 18:40:51 +0000 (19:40 +0100)
PHY type ixgbe_phy_x550em_ext_t requires different check
to verify reset status.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Wei Dai <wei.dai@intel.com>
drivers/net/ixgbe/base/ixgbe_phy.c

index 43c55d7..1d9fb3e 100644 (file)
@@ -528,11 +528,30 @@ s32 ixgbe_reset_phy_generic(struct ixgbe_hw *hw)
         */
        for (i = 0; i < 30; i++) {
                msec_delay(100);
-               hw->phy.ops.read_reg(hw, IXGBE_MDIO_PHY_XS_CONTROL,
-                                    IXGBE_MDIO_PHY_XS_DEV_TYPE, &ctrl);
-               if (!(ctrl & IXGBE_MDIO_PHY_XS_RESET)) {
-                       usec_delay(2);
-                       break;
+               if (hw->phy.type == ixgbe_phy_x550em_ext_t) {
+                       status = hw->phy.ops.read_reg(hw,
+                                                 IXGBE_MDIO_TX_VENDOR_ALARMS_3,
+                                                 IXGBE_MDIO_PMA_PMD_DEV_TYPE,
+                                                 &ctrl);
+                       if (status != IXGBE_SUCCESS)
+                               return status;
+
+                       if (ctrl & IXGBE_MDIO_TX_VENDOR_ALARMS_3_RST_MASK) {
+                               usec_delay(2);
+                               break;
+                       }
+               } else {
+                       status = hw->phy.ops.read_reg(hw,
+                                                    IXGBE_MDIO_PHY_XS_CONTROL,
+                                                    IXGBE_MDIO_PHY_XS_DEV_TYPE,
+                                                    &ctrl);
+                       if (status != IXGBE_SUCCESS)
+                               return status;
+
+                       if (!(ctrl & IXGBE_MDIO_PHY_XS_RESET)) {
+                               usec_delay(2);
+                               break;
+                       }
                }
        }