ixgbe: remove wait loop on autoneg for copper devices
authorEmil Tantilov <emil.s.tantilov@intel.com>
Sat, 6 Sep 2014 07:50:27 +0000 (07:50 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 2 Oct 2014 09:11:13 +0000 (02:11 -0700)
This patch removes couple of wait loops on autoneg that are not needed.

During validation we noticed that the loops always time out, so there
should be no user impact.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c

index 11f02ea78c4a3cabd05ec64b57942645d3818b2b..d47b19f27c355c96ea006c004afa38efac3dcfe7 100644 (file)
@@ -445,8 +445,6 @@ s32 ixgbe_write_phy_reg_generic(struct ixgbe_hw *hw, u32 reg_addr,
 s32 ixgbe_setup_phy_link_generic(struct ixgbe_hw *hw)
 {
        s32 status = 0;
-       u32 time_out;
-       u32 max_time_out = 10;
        u16 autoneg_reg = IXGBE_MII_AUTONEG_REG;
        bool autoneg = false;
        ixgbe_link_speed speed;
@@ -514,25 +512,6 @@ s32 ixgbe_setup_phy_link_generic(struct ixgbe_hw *hw)
        hw->phy.ops.write_reg(hw, MDIO_CTRL1,
                              MDIO_MMD_AN, autoneg_reg);
 
-       /* Wait for autonegotiation to finish */
-       for (time_out = 0; time_out < max_time_out; time_out++) {
-               udelay(10);
-               /* Restart PHY autonegotiation and wait for completion */
-               status = hw->phy.ops.read_reg(hw, MDIO_STAT1,
-                                             MDIO_MMD_AN,
-                                             &autoneg_reg);
-
-               autoneg_reg &= MDIO_AN_STAT1_COMPLETE;
-               if (autoneg_reg == MDIO_AN_STAT1_COMPLETE) {
-                       break;
-               }
-       }
-
-       if (time_out == max_time_out) {
-               hw_dbg(hw, "ixgbe_setup_phy_link_generic: time out\n");
-               return IXGBE_ERR_LINK_SETUP;
-       }
-
        return status;
 }
 
@@ -657,8 +636,6 @@ s32 ixgbe_check_phy_link_tnx(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
 s32 ixgbe_setup_phy_link_tnx(struct ixgbe_hw *hw)
 {
        s32 status;
-       u32 time_out;
-       u32 max_time_out = 10;
        u16 autoneg_reg = IXGBE_MII_AUTONEG_REG;
        bool autoneg = false;
        ixgbe_link_speed speed;
@@ -724,24 +701,6 @@ s32 ixgbe_setup_phy_link_tnx(struct ixgbe_hw *hw)
        hw->phy.ops.write_reg(hw, MDIO_CTRL1,
                              MDIO_MMD_AN, autoneg_reg);
 
-       /* Wait for autonegotiation to finish */
-       for (time_out = 0; time_out < max_time_out; time_out++) {
-               udelay(10);
-               /* Restart PHY autonegotiation and wait for completion */
-               status = hw->phy.ops.read_reg(hw, MDIO_STAT1,
-                                             MDIO_MMD_AN,
-                                             &autoneg_reg);
-
-               autoneg_reg &= MDIO_AN_STAT1_COMPLETE;
-               if (autoneg_reg == MDIO_AN_STAT1_COMPLETE)
-                       break;
-       }
-
-       if (time_out == max_time_out) {
-               hw_dbg(hw, "ixgbe_setup_phy_link_tnx: time out\n");
-               return IXGBE_ERR_LINK_SETUP;
-       }
-
        return status;
 }