From: Jacob Keller Date: Sat, 22 Feb 2014 01:23:55 +0000 (+0000) Subject: ixgbe: fix ixgbe_stop_mac_link_on_d3_82599 to check mng correctly X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8036d29f409f6a1d54ac409ede273197c4914e3f;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git ixgbe: fix ixgbe_stop_mac_link_on_d3_82599 to check mng correctly Previously, we did a full check to see if MNG FW was running. Instead, we should only check to see whether it could be enabled. Since it may become active while down, we don't want to bring the link down. CC: Arun Sharma Signed-off-by: Don Skidmore Signed-off-by: Jacob Keller Tested-by: Phil Schmitt Signed-off-by: Jeff Kirsher --- diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c index fcba1d9734f9..ef808bcec276 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c @@ -517,12 +517,16 @@ out: **/ static void ixgbe_stop_mac_link_on_d3_82599(struct ixgbe_hw *hw) { - u32 autoc2_reg; + u32 autoc2_reg, fwsm; u16 ee_ctrl_2 = 0; hw->eeprom.ops.read(hw, IXGBE_EEPROM_CTRL_2, &ee_ctrl_2); - if (!hw->mng_fw_enabled && !hw->wol_enabled && + /* Check to see if MNG FW could be enabled */ + fwsm = IXGBE_READ_REG(hw, IXGBE_FWSM); + + if (((fwsm & IXGBE_FWSM_MODE_MASK) != IXGBE_FWSM_FW_MODE_PT) && + !hw->wol_enabled && ee_ctrl_2 & IXGBE_EEPROM_CCD_BIT) { autoc2_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC2); autoc2_reg |= IXGBE_AUTOC2_LINK_DISABLE_ON_D3_MASK;