be2net: cancel be_worker during EEH recovery
EEH recovery involves ring cleanup and re-creation. The worker thread must not run during EEH cleanup/resume. Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
8abe6fb51e
commit
191eb75631
|
@ -304,6 +304,7 @@ struct be_vf_cfg {
|
||||||
};
|
};
|
||||||
|
|
||||||
#define BE_FLAGS_LINK_STATUS_INIT 1
|
#define BE_FLAGS_LINK_STATUS_INIT 1
|
||||||
|
#define BE_FLAGS_WORKER_SCHEDULED (1 << 3)
|
||||||
|
|
||||||
struct be_adapter {
|
struct be_adapter {
|
||||||
struct pci_dev *pdev;
|
struct pci_dev *pdev;
|
||||||
|
|
|
@ -2447,6 +2447,11 @@ static void be_vf_clear(struct be_adapter *adapter)
|
||||||
|
|
||||||
static int be_clear(struct be_adapter *adapter)
|
static int be_clear(struct be_adapter *adapter)
|
||||||
{
|
{
|
||||||
|
if (adapter->flags & BE_FLAGS_WORKER_SCHEDULED) {
|
||||||
|
cancel_delayed_work_sync(&adapter->work);
|
||||||
|
adapter->flags &= ~BE_FLAGS_WORKER_SCHEDULED;
|
||||||
|
}
|
||||||
|
|
||||||
if (sriov_enabled(adapter))
|
if (sriov_enabled(adapter))
|
||||||
be_vf_clear(adapter);
|
be_vf_clear(adapter);
|
||||||
|
|
||||||
|
@ -2648,6 +2653,9 @@ static int be_setup(struct be_adapter *adapter)
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000));
|
||||||
|
adapter->flags |= BE_FLAGS_WORKER_SCHEDULED;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
err:
|
err:
|
||||||
be_clear(adapter);
|
be_clear(adapter);
|
||||||
|
@ -3208,8 +3216,6 @@ static void __devexit be_remove(struct pci_dev *pdev)
|
||||||
if (!adapter)
|
if (!adapter)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
cancel_delayed_work_sync(&adapter->work);
|
|
||||||
|
|
||||||
unregister_netdev(adapter->netdev);
|
unregister_netdev(adapter->netdev);
|
||||||
|
|
||||||
be_clear(adapter);
|
be_clear(adapter);
|
||||||
|
@ -3533,7 +3539,6 @@ static int __devinit be_probe(struct pci_dev *pdev,
|
||||||
dev_info(&pdev->dev, "%s: %s port %d\n", netdev->name, nic_name(pdev),
|
dev_info(&pdev->dev, "%s: %s port %d\n", netdev->name, nic_name(pdev),
|
||||||
adapter->port_num);
|
adapter->port_num);
|
||||||
|
|
||||||
schedule_delayed_work(&adapter->work, msecs_to_jiffies(100));
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
unsetup:
|
unsetup:
|
||||||
|
@ -3563,7 +3568,6 @@ static int be_suspend(struct pci_dev *pdev, pm_message_t state)
|
||||||
struct be_adapter *adapter = pci_get_drvdata(pdev);
|
struct be_adapter *adapter = pci_get_drvdata(pdev);
|
||||||
struct net_device *netdev = adapter->netdev;
|
struct net_device *netdev = adapter->netdev;
|
||||||
|
|
||||||
cancel_delayed_work_sync(&adapter->work);
|
|
||||||
if (adapter->wol)
|
if (adapter->wol)
|
||||||
be_setup_wol(adapter, true);
|
be_setup_wol(adapter, true);
|
||||||
|
|
||||||
|
@ -3612,7 +3616,6 @@ static int be_resume(struct pci_dev *pdev)
|
||||||
if (adapter->wol)
|
if (adapter->wol)
|
||||||
be_setup_wol(adapter, false);
|
be_setup_wol(adapter, false);
|
||||||
|
|
||||||
schedule_delayed_work(&adapter->work, msecs_to_jiffies(100));
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue