]> git.karo-electronics.de Git - linux-beck.git/commitdiff
e1000e: Fix 82579 sets LPI too early.
authorDavid Ertman <davidx.m.ertman@intel.com>
Fri, 24 Jan 2014 23:07:48 +0000 (23:07 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Sat, 8 Mar 2014 05:48:13 +0000 (21:48 -0800)
Enabling EEE LPI sooner than one second after link up on 82579 causes link
issues with some switches.

Remove EEE enablement for 82579 parts from the link initialization flow to
avoid initializing too early.  EEE initialization for 82579 will be done
in e1000e_update_phy_task.

Signed-off-by: Dave Ertman <davidx.m.ertman@intel.com>
Acked-by: Bruce W Allan <bruce.w.allan@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/e1000e/ich8lan.c
drivers/net/ethernet/intel/e1000e/ich8lan.h
drivers/net/ethernet/intel/e1000e/netdev.c

index 4f3da87f0cef1c90ef32ba0df769723bfcdd425f..42cc537a865708d18d0147fbbc54ebfb6f838436 100644 (file)
@@ -744,8 +744,14 @@ s32 e1000_write_emi_reg_locked(struct e1000_hw *hw, u16 addr, u16 data)
  *  Enable/disable EEE based on setting in dev_spec structure, the duplex of
  *  the link and the EEE capabilities of the link partner.  The LPI Control
  *  register bits will remain set only if/when link is up.
+ *
+ *  EEE LPI must not be asserted earlier than one second after link is up.
+ *  On 82579, EEE LPI should not be enabled until such time otherwise there
+ *  can be link issues with some switches.  Other devices can have EEE LPI
+ *  enabled immediately upon link up since they have a timer in hardware which
+ *  prevents LPI from being asserted too early.
  **/
-static s32 e1000_set_eee_pchlan(struct e1000_hw *hw)
+s32 e1000_set_eee_pchlan(struct e1000_hw *hw)
 {
        struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
        s32 ret_val;
@@ -1126,9 +1132,11 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
        e1000e_check_downshift(hw);
 
        /* Enable/Disable EEE after link up */
-       ret_val = e1000_set_eee_pchlan(hw);
-       if (ret_val)
-               return ret_val;
+       if (hw->phy.type > e1000_phy_82579) {
+               ret_val = e1000_set_eee_pchlan(hw);
+               if (ret_val)
+                       return ret_val;
+       }
 
        /* If we are forcing speed/duplex, then we simply return since
         * we have already determined whether we have link or not.
index 217090df33e788d46603f1c0369a2cf4e8041719..707bf4dace49b372501a2aec82408869cf1e8bf2 100644 (file)
@@ -268,4 +268,5 @@ void e1000_copy_rx_addrs_to_phy_ich8lan(struct e1000_hw *hw);
 s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable);
 s32 e1000_read_emi_reg_locked(struct e1000_hw *hw, u16 addr, u16 *data);
 s32 e1000_write_emi_reg_locked(struct e1000_hw *hw, u16 addr, u16 data);
+s32 e1000_set_eee_pchlan(struct e1000_hw *hw);
 #endif /* _E1000E_ICH8LAN_H_ */
index 1f144e974c610d83c6bd294f43bfd1d31d6c460e..94bd92da29fade52ef3aafb3ea31bdae7fa5eb78 100644 (file)
@@ -4463,11 +4463,16 @@ static void e1000e_update_phy_task(struct work_struct *work)
        struct e1000_adapter *adapter = container_of(work,
                                                     struct e1000_adapter,
                                                     update_phy_task);
+       struct e1000_hw *hw = &adapter->hw;
 
        if (test_bit(__E1000_DOWN, &adapter->state))
                return;
 
-       e1000_get_phy_info(&adapter->hw);
+       e1000_get_phy_info(hw);
+
+       /* Enable EEE on 82579 after link up */
+       if (hw->phy.type == e1000_phy_82579)
+               e1000_set_eee_pchlan(hw);
 }
 
 /**