aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Ertman <davidx.m.ertman@intel.com>2014-01-24 18:07:48 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2014-03-08 00:48:13 -0500
commita03206edfffdeea34e7246b5a0e0da6651511062 (patch)
tree03d50ab3a58e7cc5ae7bb6414df8a3d2eb245656
parentf7235ef66938ac3db51762c5dbab9f849fa9e795 (diff)
e1000e: Fix 82579 sets LPI too early.
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>
-rw-r--r--drivers/net/ethernet/intel/e1000e/ich8lan.c16
-rw-r--r--drivers/net/ethernet/intel/e1000e/ich8lan.h1
-rw-r--r--drivers/net/ethernet/intel/e1000e/netdev.c7
3 files changed, 19 insertions, 5 deletions
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
index 4f3da87f0cef..42cc537a8657 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
@@ -744,8 +744,14 @@ s32 e1000_write_emi_reg_locked(struct e1000_hw *hw, u16 addr, u16 data)
744 * Enable/disable EEE based on setting in dev_spec structure, the duplex of 744 * Enable/disable EEE based on setting in dev_spec structure, the duplex of
745 * the link and the EEE capabilities of the link partner. The LPI Control 745 * the link and the EEE capabilities of the link partner. The LPI Control
746 * register bits will remain set only if/when link is up. 746 * register bits will remain set only if/when link is up.
747 *
748 * EEE LPI must not be asserted earlier than one second after link is up.
749 * On 82579, EEE LPI should not be enabled until such time otherwise there
750 * can be link issues with some switches. Other devices can have EEE LPI
751 * enabled immediately upon link up since they have a timer in hardware which
752 * prevents LPI from being asserted too early.
747 **/ 753 **/
748static s32 e1000_set_eee_pchlan(struct e1000_hw *hw) 754s32 e1000_set_eee_pchlan(struct e1000_hw *hw)
749{ 755{
750 struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan; 756 struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
751 s32 ret_val; 757 s32 ret_val;
@@ -1126,9 +1132,11 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
1126 e1000e_check_downshift(hw); 1132 e1000e_check_downshift(hw);
1127 1133
1128 /* Enable/Disable EEE after link up */ 1134 /* Enable/Disable EEE after link up */
1129 ret_val = e1000_set_eee_pchlan(hw); 1135 if (hw->phy.type > e1000_phy_82579) {
1130 if (ret_val) 1136 ret_val = e1000_set_eee_pchlan(hw);
1131 return ret_val; 1137 if (ret_val)
1138 return ret_val;
1139 }
1132 1140
1133 /* If we are forcing speed/duplex, then we simply return since 1141 /* If we are forcing speed/duplex, then we simply return since
1134 * we have already determined whether we have link or not. 1142 * we have already determined whether we have link or not.
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.h b/drivers/net/ethernet/intel/e1000e/ich8lan.h
index 217090df33e7..707bf4dace49 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.h
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.h
@@ -268,4 +268,5 @@ void e1000_copy_rx_addrs_to_phy_ich8lan(struct e1000_hw *hw);
268s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable); 268s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable);
269s32 e1000_read_emi_reg_locked(struct e1000_hw *hw, u16 addr, u16 *data); 269s32 e1000_read_emi_reg_locked(struct e1000_hw *hw, u16 addr, u16 *data);
270s32 e1000_write_emi_reg_locked(struct e1000_hw *hw, u16 addr, u16 data); 270s32 e1000_write_emi_reg_locked(struct e1000_hw *hw, u16 addr, u16 data);
271s32 e1000_set_eee_pchlan(struct e1000_hw *hw);
271#endif /* _E1000E_ICH8LAN_H_ */ 272#endif /* _E1000E_ICH8LAN_H_ */
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 1f144e974c61..94bd92da29fa 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -4463,11 +4463,16 @@ static void e1000e_update_phy_task(struct work_struct *work)
4463 struct e1000_adapter *adapter = container_of(work, 4463 struct e1000_adapter *adapter = container_of(work,
4464 struct e1000_adapter, 4464 struct e1000_adapter,
4465 update_phy_task); 4465 update_phy_task);
4466 struct e1000_hw *hw = &adapter->hw;
4466 4467
4467 if (test_bit(__E1000_DOWN, &adapter->state)) 4468 if (test_bit(__E1000_DOWN, &adapter->state))
4468 return; 4469 return;
4469 4470
4470 e1000_get_phy_info(&adapter->hw); 4471 e1000_get_phy_info(hw);
4472
4473 /* Enable EEE on 82579 after link up */
4474 if (hw->phy.type == e1000_phy_82579)
4475 e1000_set_eee_pchlan(hw);
4471} 4476}
4472 4477
4473/** 4478/**