提交 dbb01c8a 编写于 作者: M Mitch Williams 提交者: David S. Miller

i40evf: fix multiple crashes on remove

Depending upon the state of the driver, there are several potential
pitfalls on remove. Kill the watchdog task so rmmod doesn't hang.
Check the adapter->msix_entries field, not the num_msix_vectors field,
which is never cleared.

Change-ID: I0546048477f09fc19e481bd37efa30daae4faa88
Signed-off-by: NMitch Williams <mitch.a.williams@intel.com>
Signed-off-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: NSibai Li <sibai.li@intel.com>
Signed-off-by: NAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ed1f5b58
......@@ -215,6 +215,9 @@ static void i40evf_irq_disable(struct i40evf_adapter *adapter)
int i;
struct i40e_hw *hw = &adapter->hw;
if (!adapter->msix_entries)
return;
for (i = 1; i < adapter->num_msix_vectors; i++) {
wr32(hw, I40E_VFINT_DYN_CTLN1(i - 1), 0);
synchronize_irq(adapter->msix_entries[i].vector);
......@@ -2372,17 +2375,15 @@ static void i40evf_remove(struct pci_dev *pdev)
}
adapter->state = __I40EVF_REMOVE;
if (adapter->num_msix_vectors) {
if (adapter->msix_entries) {
i40evf_misc_irq_disable(adapter);
del_timer_sync(&adapter->watchdog_timer);
flush_scheduled_work();
i40evf_free_misc_irq(adapter);
i40evf_reset_interrupt_capability(adapter);
}
del_timer_sync(&adapter->watchdog_timer);
flush_scheduled_work();
if (hw->aq.asq.count)
i40evf_shutdown_adminq(hw);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册