aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Brandeburg <jesse.brandeburg@intel.com>2009-09-25 08:17:23 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-26 23:15:34 -0400
commitbaa34745fe6263c733f43feddb0b8100d6538f37 (patch)
treec77d8e304a958f01f9665a51e1703e1f20c499dd
parent51851073093f36a626de5f5eb1b87db9cae7e0d2 (diff)
e1000: stop timers at appropriate times
there were some hotplug cases that made timers still run after the driver had been removed, make sure to stop all the timers and not allow racy reschedules. Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/e1000/e1000_main.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 4d6677e4f9f2..7af3255a8e9c 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -1098,6 +1098,11 @@ static void __devexit e1000_remove(struct pci_dev *pdev)
1098 struct e1000_adapter *adapter = netdev_priv(netdev); 1098 struct e1000_adapter *adapter = netdev_priv(netdev);
1099 struct e1000_hw *hw = &adapter->hw; 1099 struct e1000_hw *hw = &adapter->hw;
1100 1100
1101 set_bit(__E1000_DOWN, &adapter->flags);
1102 del_timer_sync(&adapter->tx_fifo_stall_timer);
1103 del_timer_sync(&adapter->watchdog_timer);
1104 del_timer_sync(&adapter->phy_info_timer);
1105
1101 cancel_work_sync(&adapter->reset_task); 1106 cancel_work_sync(&adapter->reset_task);
1102 1107
1103 e1000_release_manageability(adapter); 1108 e1000_release_manageability(adapter);
@@ -2240,7 +2245,7 @@ static void e1000_82547_tx_fifo_stall(unsigned long data)
2240 adapter->tx_fifo_head = 0; 2245 adapter->tx_fifo_head = 0;
2241 atomic_set(&adapter->tx_fifo_stall, 0); 2246 atomic_set(&adapter->tx_fifo_stall, 0);
2242 netif_wake_queue(netdev); 2247 netif_wake_queue(netdev);
2243 } else { 2248 } else if (!test_bit(__E1000_DOWN, &adapter->flags)) {
2244 mod_timer(&adapter->tx_fifo_stall_timer, jiffies + 1); 2249 mod_timer(&adapter->tx_fifo_stall_timer, jiffies + 1);
2245 } 2250 }
2246 } 2251 }
@@ -2309,8 +2314,9 @@ static void e1000_watchdog(unsigned long data)
2309 ew32(TCTL, tctl); 2314 ew32(TCTL, tctl);
2310 2315
2311 netif_carrier_on(netdev); 2316 netif_carrier_on(netdev);
2312 mod_timer(&adapter->phy_info_timer, 2317 if (!test_bit(__E1000_DOWN, &adapter->flags))
2313 round_jiffies(jiffies + 2 * HZ)); 2318 mod_timer(&adapter->phy_info_timer,
2319 round_jiffies(jiffies + 2 * HZ));
2314 adapter->smartspeed = 0; 2320 adapter->smartspeed = 0;
2315 } 2321 }
2316 } else { 2322 } else {
@@ -2320,8 +2326,10 @@ static void e1000_watchdog(unsigned long data)
2320 printk(KERN_INFO "e1000: %s NIC Link is Down\n", 2326 printk(KERN_INFO "e1000: %s NIC Link is Down\n",
2321 netdev->name); 2327 netdev->name);
2322 netif_carrier_off(netdev); 2328 netif_carrier_off(netdev);
2323 mod_timer(&adapter->phy_info_timer, 2329
2324 round_jiffies(jiffies + 2 * HZ)); 2330 if (!test_bit(__E1000_DOWN, &adapter->flags))
2331 mod_timer(&adapter->phy_info_timer,
2332 round_jiffies(jiffies + 2 * HZ));
2325 } 2333 }
2326 2334
2327 e1000_smartspeed(adapter); 2335 e1000_smartspeed(adapter);
@@ -2361,7 +2369,9 @@ static void e1000_watchdog(unsigned long data)
2361 adapter->detect_tx_hung = true; 2369 adapter->detect_tx_hung = true;
2362 2370
2363 /* Reset the timer */ 2371 /* Reset the timer */
2364 mod_timer(&adapter->watchdog_timer, round_jiffies(jiffies + 2 * HZ)); 2372 if (!test_bit(__E1000_DOWN, &adapter->flags))
2373 mod_timer(&adapter->watchdog_timer,
2374 round_jiffies(jiffies + 2 * HZ));
2365} 2375}
2366 2376
2367enum latency_range { 2377enum latency_range {
@@ -2977,7 +2987,9 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
2977 if (unlikely(hw->mac_type == e1000_82547)) { 2987 if (unlikely(hw->mac_type == e1000_82547)) {
2978 if (unlikely(e1000_82547_fifo_workaround(adapter, skb))) { 2988 if (unlikely(e1000_82547_fifo_workaround(adapter, skb))) {
2979 netif_stop_queue(netdev); 2989 netif_stop_queue(netdev);
2980 mod_timer(&adapter->tx_fifo_stall_timer, jiffies + 1); 2990 if (!test_bit(__E1000_DOWN, &adapter->flags))
2991 mod_timer(&adapter->tx_fifo_stall_timer,
2992 jiffies + 1);
2981 return NETDEV_TX_BUSY; 2993 return NETDEV_TX_BUSY;
2982 } 2994 }
2983 } 2995 }