e1000e: reset PHY after errors detected
[deliverable/linux.git] / drivers / net / e1000e / netdev.c
index ec8cf3f51423fbf12fbdb9794ce1684f314b5140..35a9dd4353d7763aca0abe0fb2f7212bc81a29ed 100644 (file)
@@ -4098,6 +4098,25 @@ static void e1000e_enable_receives(struct e1000_adapter *adapter)
        }
 }
 
+static void e1000e_check_82574_phy_workaround(struct e1000_adapter *adapter)
+{
+       struct e1000_hw *hw = &adapter->hw;
+
+       /*
+        * With 82574 controllers, PHY needs to be checked periodically
+        * for hung state and reset, if two calls return true
+        */
+       if (e1000_check_phy_82574(hw))
+               adapter->phy_hang_count++;
+       else
+               adapter->phy_hang_count = 0;
+
+       if (adapter->phy_hang_count > 1) {
+               adapter->phy_hang_count = 0;
+               schedule_work(&adapter->reset_task);
+       }
+}
+
 /**
  * e1000_watchdog - Timer Call-back
  * @data: pointer to adapter cast into an unsigned long
@@ -4333,6 +4352,9 @@ link_up:
        if (e1000e_get_laa_state_82571(hw))
                e1000e_rar_set(hw, adapter->hw.mac.addr, 0);
 
+       if (adapter->flags2 & FLAG2_CHECK_PHY_HANG)
+               e1000e_check_82574_phy_workaround(adapter);
+
        /* Reset the timer */
        if (!test_bit(__E1000_DOWN, &adapter->state))
                mod_timer(&adapter->watchdog_timer,
This page took 0.031157 seconds and 5 git commands to generate.