|
@@ -1803,6 +1803,12 @@ static void i40evf_reset_task(struct work_struct *work)
|
|
|
int i = 0, err;
|
|
|
bool running;
|
|
|
|
|
|
+ /* When device is being removed it doesn't make sense to run the reset
|
|
|
+ * task, just return in such a case.
|
|
|
+ */
|
|
|
+ if (test_bit(__I40EVF_IN_REMOVE_TASK, &adapter->crit_section))
|
|
|
+ return;
|
|
|
+
|
|
|
while (test_and_set_bit(__I40EVF_IN_CLIENT_TASK,
|
|
|
&adapter->crit_section))
|
|
|
usleep_range(500, 1000);
|
|
@@ -3053,7 +3059,8 @@ static void i40evf_remove(struct pci_dev *pdev)
|
|
|
struct i40evf_mac_filter *f, *ftmp;
|
|
|
struct i40e_hw *hw = &adapter->hw;
|
|
|
int err;
|
|
|
-
|
|
|
+ /* Indicate we are in remove and not to run reset_task */
|
|
|
+ set_bit(__I40EVF_IN_REMOVE_TASK, &adapter->crit_section);
|
|
|
cancel_delayed_work_sync(&adapter->init_task);
|
|
|
cancel_work_sync(&adapter->reset_task);
|
|
|
cancel_delayed_work_sync(&adapter->client_task);
|