diff options
author | Tejun Heo <tj@kernel.org> | 2010-12-12 10:45:14 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2010-12-12 10:45:14 -0500 |
commit | 760141a53e5d72d4cc1d8c6e2a0232a24bedb36b (patch) | |
tree | 662158c0c23ee16e2bc16d9ba53eeadc6d9fa17e /drivers | |
parent | 9beb4896cec71e40738a7752072174fbf0d5b7b4 (diff) |
igb[v],ixgbe: don't use flush_scheduled_work()
All three drivers use flush_scheduled_work() similarly during driver
detach. Replace it with explicit cancels.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: e1000-devel@lists.sourceforge.net
Cc: netdev@vger.kernel.org
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/igb/igb_main.c | 9 | ||||
-rw-r--r-- | drivers/net/igbvf/netdev.c | 7 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 11 |
3 files changed, 17 insertions, 10 deletions
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index 041f8e6f74f4..62348fc60e53 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -2050,13 +2050,16 @@ static void __devexit igb_remove(struct pci_dev *pdev) | |||
2050 | struct igb_adapter *adapter = netdev_priv(netdev); | 2050 | struct igb_adapter *adapter = netdev_priv(netdev); |
2051 | struct e1000_hw *hw = &adapter->hw; | 2051 | struct e1000_hw *hw = &adapter->hw; |
2052 | 2052 | ||
2053 | /* flush_scheduled work may reschedule our watchdog task, so | 2053 | /* |
2054 | * explicitly disable watchdog tasks from being rescheduled */ | 2054 | * The watchdog timer may be rescheduled, so explicitly |
2055 | * disable watchdog from being rescheduled. | ||
2056 | */ | ||
2055 | set_bit(__IGB_DOWN, &adapter->state); | 2057 | set_bit(__IGB_DOWN, &adapter->state); |
2056 | del_timer_sync(&adapter->watchdog_timer); | 2058 | del_timer_sync(&adapter->watchdog_timer); |
2057 | del_timer_sync(&adapter->phy_info_timer); | 2059 | del_timer_sync(&adapter->phy_info_timer); |
2058 | 2060 | ||
2059 | flush_scheduled_work(); | 2061 | cancel_work_sync(&adapter->reset_task); |
2062 | cancel_work_sync(&adapter->watchdog_task); | ||
2060 | 2063 | ||
2061 | #ifdef CONFIG_IGB_DCA | 2064 | #ifdef CONFIG_IGB_DCA |
2062 | if (adapter->flags & IGB_FLAG_DCA_ENABLED) { | 2065 | if (adapter->flags & IGB_FLAG_DCA_ENABLED) { |
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c index 8dbde2397c10..4fb023bce785 100644 --- a/drivers/net/igbvf/netdev.c +++ b/drivers/net/igbvf/netdev.c | |||
@@ -2825,13 +2825,14 @@ static void __devexit igbvf_remove(struct pci_dev *pdev) | |||
2825 | struct e1000_hw *hw = &adapter->hw; | 2825 | struct e1000_hw *hw = &adapter->hw; |
2826 | 2826 | ||
2827 | /* | 2827 | /* |
2828 | * flush_scheduled work may reschedule our watchdog task, so | 2828 | * The watchdog timer may be rescheduled, so explicitly |
2829 | * explicitly disable watchdog tasks from being rescheduled | 2829 | * disable it from being rescheduled. |
2830 | */ | 2830 | */ |
2831 | set_bit(__IGBVF_DOWN, &adapter->state); | 2831 | set_bit(__IGBVF_DOWN, &adapter->state); |
2832 | del_timer_sync(&adapter->watchdog_timer); | 2832 | del_timer_sync(&adapter->watchdog_timer); |
2833 | 2833 | ||
2834 | flush_scheduled_work(); | 2834 | cancel_work_sync(&adapter->reset_task); |
2835 | cancel_work_sync(&adapter->watchdog_task); | ||
2835 | 2836 | ||
2836 | unregister_netdev(netdev); | 2837 | unregister_netdev(netdev); |
2837 | 2838 | ||
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 8af0fc051696..ca9036de49f9 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -7373,13 +7373,15 @@ static void __devexit ixgbe_remove(struct pci_dev *pdev) | |||
7373 | struct net_device *netdev = adapter->netdev; | 7373 | struct net_device *netdev = adapter->netdev; |
7374 | 7374 | ||
7375 | set_bit(__IXGBE_DOWN, &adapter->state); | 7375 | set_bit(__IXGBE_DOWN, &adapter->state); |
7376 | /* clear the module not found bit to make sure the worker won't | 7376 | |
7377 | * reschedule | 7377 | /* |
7378 | * The timers may be rescheduled, so explicitly disable them | ||
7379 | * from being rescheduled. | ||
7378 | */ | 7380 | */ |
7379 | clear_bit(__IXGBE_SFP_MODULE_NOT_FOUND, &adapter->state); | 7381 | clear_bit(__IXGBE_SFP_MODULE_NOT_FOUND, &adapter->state); |
7380 | del_timer_sync(&adapter->watchdog_timer); | 7382 | del_timer_sync(&adapter->watchdog_timer); |
7381 | |||
7382 | del_timer_sync(&adapter->sfp_timer); | 7383 | del_timer_sync(&adapter->sfp_timer); |
7384 | |||
7383 | cancel_work_sync(&adapter->watchdog_task); | 7385 | cancel_work_sync(&adapter->watchdog_task); |
7384 | cancel_work_sync(&adapter->sfp_task); | 7386 | cancel_work_sync(&adapter->sfp_task); |
7385 | cancel_work_sync(&adapter->multispeed_fiber_task); | 7387 | cancel_work_sync(&adapter->multispeed_fiber_task); |
@@ -7387,7 +7389,8 @@ static void __devexit ixgbe_remove(struct pci_dev *pdev) | |||
7387 | if (adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE || | 7389 | if (adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE || |
7388 | adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE) | 7390 | adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE) |
7389 | cancel_work_sync(&adapter->fdir_reinit_task); | 7391 | cancel_work_sync(&adapter->fdir_reinit_task); |
7390 | flush_scheduled_work(); | 7392 | if (adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_CAPABLE) |
7393 | cancel_work_sync(&adapter->check_overtemp_task); | ||
7391 | 7394 | ||
7392 | #ifdef CONFIG_IXGBE_DCA | 7395 | #ifdef CONFIG_IXGBE_DCA |
7393 | if (adapter->flags & IXGBE_FLAG_DCA_ENABLED) { | 7396 | if (adapter->flags & IXGBE_FLAG_DCA_ENABLED) { |