aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Rustad <mark.d.rustad@intel.com>2014-03-03 22:02:13 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2014-03-19 20:17:24 -0400
commit2e7cfbdde8412a95ea4b003a68c2737434f543bb (patch)
treef3bbc071b98324b0f88599bf22c8b4149a19f2a0
parented19231c760a5103d75d285ca5a5ba4177ec09eb (diff)
ixgbevf: Indicate removal state explicitly
Add a bit, __IXGBEVF_REMOVING, to indicate that the module is being removed. The __IXGBEVF_DOWN bit had been overloaded for this purpose, but that leads to trouble. A few places now check both __IXGBEVF_DOWN and __IXGBEVF_REMOVING. Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/ixgbevf/ixgbevf.h5
-rw-r--r--drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c14
2 files changed, 12 insertions, 7 deletions
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
index 54829326bb09..08fb88aba67b 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
@@ -1,7 +1,7 @@
1/******************************************************************************* 1/*******************************************************************************
2 2
3 Intel 82599 Virtual Function driver 3 Intel 82599 Virtual Function driver
4 Copyright(c) 1999 - 2012 Intel Corporation. 4 Copyright(c) 1999 - 2014 Intel Corporation.
5 5
6 This program is free software; you can redistribute it and/or modify it 6 This program is free software; you can redistribute it and/or modify it
7 under the terms and conditions of the GNU General Public License, 7 under the terms and conditions of the GNU General Public License,
@@ -412,7 +412,8 @@ struct ixgbevf_adapter {
412enum ixbgevf_state_t { 412enum ixbgevf_state_t {
413 __IXGBEVF_TESTING, 413 __IXGBEVF_TESTING,
414 __IXGBEVF_RESETTING, 414 __IXGBEVF_RESETTING,
415 __IXGBEVF_DOWN 415 __IXGBEVF_DOWN,
416 __IXGBEVF_REMOVING,
416}; 417};
417 418
418struct ixgbevf_cb { 419struct ixgbevf_cb {
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 8581079791fe..940d9244df62 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -1,7 +1,7 @@
1/******************************************************************************* 1/*******************************************************************************
2 2
3 Intel 82599 Virtual Function driver 3 Intel 82599 Virtual Function driver
4 Copyright(c) 1999 - 2012 Intel Corporation. 4 Copyright(c) 1999 - 2014 Intel Corporation.
5 5
6 This program is free software; you can redistribute it and/or modify it 6 This program is free software; you can redistribute it and/or modify it
7 under the terms and conditions of the GNU General Public License, 7 under the terms and conditions of the GNU General Public License,
@@ -608,7 +608,8 @@ static int ixgbevf_poll(struct napi_struct *napi, int budget)
608 napi_complete(napi); 608 napi_complete(napi);
609 if (adapter->rx_itr_setting & 1) 609 if (adapter->rx_itr_setting & 1)
610 ixgbevf_set_itr(q_vector); 610 ixgbevf_set_itr(q_vector);
611 if (!test_bit(__IXGBEVF_DOWN, &adapter->state)) 611 if (!test_bit(__IXGBEVF_DOWN, &adapter->state) &&
612 !test_bit(__IXGBEVF_REMOVING, &adapter->state))
612 ixgbevf_irq_enable_queues(adapter, 613 ixgbevf_irq_enable_queues(adapter,
613 1 << q_vector->v_idx); 614 1 << q_vector->v_idx);
614 615
@@ -833,7 +834,8 @@ static irqreturn_t ixgbevf_msix_other(int irq, void *data)
833 834
834 hw->mac.get_link_status = 1; 835 hw->mac.get_link_status = 1;
835 836
836 if (!test_bit(__IXGBEVF_DOWN, &adapter->state)) 837 if (!test_bit(__IXGBEVF_DOWN, &adapter->state) &&
838 !test_bit(__IXGBEVF_REMOVING, &adapter->state))
837 mod_timer(&adapter->watchdog_timer, jiffies); 839 mod_timer(&adapter->watchdog_timer, jiffies);
838 840
839 IXGBE_WRITE_REG(hw, IXGBE_VTEIMS, adapter->eims_other); 841 IXGBE_WRITE_REG(hw, IXGBE_VTEIMS, adapter->eims_other);
@@ -2329,6 +2331,7 @@ static void ixgbevf_reset_task(struct work_struct *work)
2329 2331
2330 /* If we're already down or resetting, just bail */ 2332 /* If we're already down or resetting, just bail */
2331 if (test_bit(__IXGBEVF_DOWN, &adapter->state) || 2333 if (test_bit(__IXGBEVF_DOWN, &adapter->state) ||
2334 test_bit(__IXGBEVF_REMOVING, &adapter->state) ||
2332 test_bit(__IXGBEVF_RESETTING, &adapter->state)) 2335 test_bit(__IXGBEVF_RESETTING, &adapter->state))
2333 return; 2336 return;
2334 2337
@@ -2413,7 +2416,8 @@ static void ixgbevf_watchdog_task(struct work_struct *work)
2413 2416
2414pf_has_reset: 2417pf_has_reset:
2415 /* Reset the timer */ 2418 /* Reset the timer */
2416 if (!test_bit(__IXGBEVF_DOWN, &adapter->state)) 2419 if (!test_bit(__IXGBEVF_DOWN, &adapter->state) &&
2420 !test_bit(__IXGBEVF_REMOVING, &adapter->state))
2417 mod_timer(&adapter->watchdog_timer, 2421 mod_timer(&adapter->watchdog_timer,
2418 round_jiffies(jiffies + (2 * HZ))); 2422 round_jiffies(jiffies + (2 * HZ)));
2419 2423
@@ -3563,7 +3567,7 @@ static void ixgbevf_remove(struct pci_dev *pdev)
3563 struct net_device *netdev = pci_get_drvdata(pdev); 3567 struct net_device *netdev = pci_get_drvdata(pdev);
3564 struct ixgbevf_adapter *adapter = netdev_priv(netdev); 3568 struct ixgbevf_adapter *adapter = netdev_priv(netdev);
3565 3569
3566 set_bit(__IXGBEVF_DOWN, &adapter->state); 3570 set_bit(__IXGBEVF_REMOVING, &adapter->state);
3567 3571
3568 del_timer_sync(&adapter->watchdog_timer); 3572 del_timer_sync(&adapter->watchdog_timer);
3569 3573