diff options
-rw-r--r-- | drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 11 |
2 files changed, 11 insertions, 1 deletions
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h index e7e7d695816b..a0a1de9ce238 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | |||
@@ -421,6 +421,7 @@ enum ixbgevf_state_t { | |||
421 | __IXGBEVF_DOWN, | 421 | __IXGBEVF_DOWN, |
422 | __IXGBEVF_DISABLED, | 422 | __IXGBEVF_DISABLED, |
423 | __IXGBEVF_REMOVING, | 423 | __IXGBEVF_REMOVING, |
424 | __IXGBEVF_WORK_INIT, | ||
424 | }; | 425 | }; |
425 | 426 | ||
426 | struct ixgbevf_cb { | 427 | struct ixgbevf_cb { |
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index 4ba139b2d25a..905c26cfa600 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | |||
@@ -107,7 +107,8 @@ static void ixgbevf_remove_adapter(struct ixgbe_hw *hw) | |||
107 | return; | 107 | return; |
108 | hw->hw_addr = NULL; | 108 | hw->hw_addr = NULL; |
109 | dev_err(&adapter->pdev->dev, "Adapter removed\n"); | 109 | dev_err(&adapter->pdev->dev, "Adapter removed\n"); |
110 | schedule_work(&adapter->watchdog_task); | 110 | if (test_bit(__IXGBEVF_WORK_INIT, &adapter->state)) |
111 | schedule_work(&adapter->watchdog_task); | ||
111 | } | 112 | } |
112 | 113 | ||
113 | static void ixgbevf_check_remove(struct ixgbe_hw *hw, u32 reg) | 114 | static void ixgbevf_check_remove(struct ixgbe_hw *hw, u32 reg) |
@@ -3573,8 +3574,13 @@ static int ixgbevf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3573 | adapter->watchdog_timer.function = ixgbevf_watchdog; | 3574 | adapter->watchdog_timer.function = ixgbevf_watchdog; |
3574 | adapter->watchdog_timer.data = (unsigned long)adapter; | 3575 | adapter->watchdog_timer.data = (unsigned long)adapter; |
3575 | 3576 | ||
3577 | if (IXGBE_REMOVED(hw->hw_addr)) { | ||
3578 | err = -EIO; | ||
3579 | goto err_sw_init; | ||
3580 | } | ||
3576 | INIT_WORK(&adapter->reset_task, ixgbevf_reset_task); | 3581 | INIT_WORK(&adapter->reset_task, ixgbevf_reset_task); |
3577 | INIT_WORK(&adapter->watchdog_task, ixgbevf_watchdog_task); | 3582 | INIT_WORK(&adapter->watchdog_task, ixgbevf_watchdog_task); |
3583 | set_bit(__IXGBEVF_WORK_INIT, &adapter->state); | ||
3578 | 3584 | ||
3579 | err = ixgbevf_init_interrupt_scheme(adapter); | 3585 | err = ixgbevf_init_interrupt_scheme(adapter); |
3580 | if (err) | 3586 | if (err) |
@@ -3667,6 +3673,9 @@ static pci_ers_result_t ixgbevf_io_error_detected(struct pci_dev *pdev, | |||
3667 | struct net_device *netdev = pci_get_drvdata(pdev); | 3673 | struct net_device *netdev = pci_get_drvdata(pdev); |
3668 | struct ixgbevf_adapter *adapter = netdev_priv(netdev); | 3674 | struct ixgbevf_adapter *adapter = netdev_priv(netdev); |
3669 | 3675 | ||
3676 | if (!test_bit(__IXGBEVF_WORK_INIT, &adapter->state)) | ||
3677 | return PCI_ERS_RESULT_DISCONNECT; | ||
3678 | |||
3670 | rtnl_lock(); | 3679 | rtnl_lock(); |
3671 | netif_device_detach(netdev); | 3680 | netif_device_detach(netdev); |
3672 | 3681 | ||