aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000e/netdev.c
diff options
context:
space:
mode:
authorCarolyn Wyborny <carolyn.wyborny@intel.com>2010-10-27 20:59:53 -0400
committerDavid S. Miller <davem@davemloft.net>2010-10-28 13:18:59 -0400
commitff10e13cd06f3dbe90e9fffc3c2dd2057a116e4b (patch)
tree673e0bf9ad8a7b78cc646e0c90cb390378202f2c /drivers/net/e1000e/netdev.c
parent116c1ea0aa871a2d6554e7fae124fc2880a596c1 (diff)
e1000e: reset PHY after errors detected
Some errors can be induced in the PHY via environmental testing (specifically extreme temperature changes and electro static discharge testing), and in the case of the PHY hanging due to this input, this detects the problem and resets to continue. This issue only applies to 82574 silicon. Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com> Tested-by: Emil Tantilov <emil.s.tantilov@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/e1000e/netdev.c')
-rw-r--r--drivers/net/e1000e/netdev.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index ec8cf3f51423..35a9dd4353d7 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -4098,6 +4098,25 @@ static void e1000e_enable_receives(struct e1000_adapter *adapter)
4098 } 4098 }
4099} 4099}
4100 4100
4101static void e1000e_check_82574_phy_workaround(struct e1000_adapter *adapter)
4102{
4103 struct e1000_hw *hw = &adapter->hw;
4104
4105 /*
4106 * With 82574 controllers, PHY needs to be checked periodically
4107 * for hung state and reset, if two calls return true
4108 */
4109 if (e1000_check_phy_82574(hw))
4110 adapter->phy_hang_count++;
4111 else
4112 adapter->phy_hang_count = 0;
4113
4114 if (adapter->phy_hang_count > 1) {
4115 adapter->phy_hang_count = 0;
4116 schedule_work(&adapter->reset_task);
4117 }
4118}
4119
4101/** 4120/**
4102 * e1000_watchdog - Timer Call-back 4121 * e1000_watchdog - Timer Call-back
4103 * @data: pointer to adapter cast into an unsigned long 4122 * @data: pointer to adapter cast into an unsigned long
@@ -4333,6 +4352,9 @@ link_up:
4333 if (e1000e_get_laa_state_82571(hw)) 4352 if (e1000e_get_laa_state_82571(hw))
4334 e1000e_rar_set(hw, adapter->hw.mac.addr, 0); 4353 e1000e_rar_set(hw, adapter->hw.mac.addr, 0);
4335 4354
4355 if (adapter->flags2 & FLAG2_CHECK_PHY_HANG)
4356 e1000e_check_82574_phy_workaround(adapter);
4357
4336 /* Reset the timer */ 4358 /* Reset the timer */
4337 if (!test_bit(__E1000_DOWN, &adapter->state)) 4359 if (!test_bit(__E1000_DOWN, &adapter->state))
4338 mod_timer(&adapter->watchdog_timer, 4360 mod_timer(&adapter->watchdog_timer,