e1000: driver state fixes (race fix)

We were plagued by our interrupt handler posting a watchdog event which
could occur when our adapter was going down in case a late packet arrived
just before e1000_down() finished. This caused the watchdog timer to start
after the NIC was down and keep rescheduling it every N seconds. Once
the driver unloaded it would panic.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
This commit is contained in:
Auke Kok
2006-09-27 12:54:02 -07:00
committed by Auke Kok
parent 4f5f2317fb
commit 1314bbf3a3
3 changed files with 23 additions and 14 deletions

View File

@@ -1624,7 +1624,7 @@ e1000_diag_test(struct net_device *netdev,
struct e1000_adapter *adapter = netdev_priv(netdev);
boolean_t if_running = netif_running(netdev);
set_bit(__E1000_DRIVER_TESTING, &adapter->flags);
set_bit(__E1000_TESTING, &adapter->flags);
if (eth_test->flags == ETH_TEST_FL_OFFLINE) {
/* Offline tests */
@@ -1669,7 +1669,7 @@ e1000_diag_test(struct net_device *netdev,
adapter->hw.autoneg = autoneg;
e1000_reset(adapter);
clear_bit(__E1000_DRIVER_TESTING, &adapter->flags);
clear_bit(__E1000_TESTING, &adapter->flags);
if (if_running)
dev_open(netdev);
} else {
@@ -1684,7 +1684,7 @@ e1000_diag_test(struct net_device *netdev,
data[2] = 0;
data[3] = 0;
clear_bit(__E1000_DRIVER_TESTING, &adapter->flags);
clear_bit(__E1000_TESTING, &adapter->flags);
}
msleep_interruptible(4 * 1000);
}