diff options
Diffstat (limited to 'drivers/net/e1000e/netdev.c')
-rw-r--r-- | drivers/net/e1000e/netdev.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index ec8cf3f51423..c4ca1629f532 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 | ||
4101 | static 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, |
@@ -4860,8 +4882,11 @@ static void e1000_reset_task(struct work_struct *work) | |||
4860 | struct e1000_adapter *adapter; | 4882 | struct e1000_adapter *adapter; |
4861 | adapter = container_of(work, struct e1000_adapter, reset_task); | 4883 | adapter = container_of(work, struct e1000_adapter, reset_task); |
4862 | 4884 | ||
4863 | e1000e_dump(adapter); | 4885 | if (!((adapter->flags & FLAG_RX_NEEDS_RESTART) && |
4864 | e_err("Reset adapter\n"); | 4886 | (adapter->flags & FLAG_RX_RESTART_NOW))) { |
4887 | e1000e_dump(adapter); | ||
4888 | e_err("Reset adapter\n"); | ||
4889 | } | ||
4865 | e1000e_reinit_locked(adapter); | 4890 | e1000e_reinit_locked(adapter); |
4866 | } | 4891 | } |
4867 | 4892 | ||