net: thunderx: Wait for delayed work to finish before destroying it
While VNIC or BGX driver teardown, wait for already scheduled delayed work to finish before destroying it. Signed-off-by: Thanneeru Srinivasulu <tsrinivasulu@caviumnetworks.com> Signed-off-by: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
723cda5b05
commit
a7b1f535a8
@@ -1074,8 +1074,7 @@ static void nic_remove(struct pci_dev *pdev)
|
|||||||
|
|
||||||
if (nic->check_link) {
|
if (nic->check_link) {
|
||||||
/* Destroy work Queue */
|
/* Destroy work Queue */
|
||||||
cancel_delayed_work(&nic->dwork);
|
cancel_delayed_work_sync(&nic->dwork);
|
||||||
flush_workqueue(nic->check_link);
|
|
||||||
destroy_workqueue(nic->check_link);
|
destroy_workqueue(nic->check_link);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -695,8 +695,7 @@ static void bgx_lmac_disable(struct bgx *bgx, u8 lmacid)
|
|||||||
lmac = &bgx->lmac[lmacid];
|
lmac = &bgx->lmac[lmacid];
|
||||||
if (lmac->check_link) {
|
if (lmac->check_link) {
|
||||||
/* Destroy work queue */
|
/* Destroy work queue */
|
||||||
cancel_delayed_work(&lmac->dwork);
|
cancel_delayed_work_sync(&lmac->dwork);
|
||||||
flush_workqueue(lmac->check_link);
|
|
||||||
destroy_workqueue(lmac->check_link);
|
destroy_workqueue(lmac->check_link);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user