Skip to contentSkip to conversation

net: thunderx: Wait for delayed work to finish before destroying it

PATCH In review Sunil Goutham 1 participant 1 message Nov 30, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/13 net: thunderx: Wait for delayed work to finish before destroying it

From: Thanneeru Srinivasulu <[email protected]>

While VNIC or BGX driver teardown, wait for already scheduled delayed work to finish before destroying it.

---
 drivers/net/ethernet/cavium/thunder/nic_main.c    |    3 +--
 drivers/net/ethernet/cavium/thunder/thunder_bgx.c |    3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/cavium/thunder/nic_main.c +1 -2
index c561fdc..cfc24a1 100644
@@ -1074,8 +1074,7 @@ static void nic_remove(struct pci_dev *pdev)
 
 	if (nic->check_link) {
 		/* Destroy work Queue */
-		cancel_delayed_work(&nic->dwork);
-		flush_workqueue(nic->check_link);
+		cancel_delayed_work_sync(&nic->dwork);
 		destroy_workqueue(nic->check_link);
 	}
 
drivers/net/ethernet/cavium/thunder/thunder_bgx.c +1 -2
index 1fb72dd..2076ac3 100644
@@ -695,8 +695,7 @@ static void bgx_lmac_disable(struct bgx *bgx, u8 lmacid)
 	lmac = &bgx->lmac[lmacid];
 	if (lmac->check_link) {
 		/* Destroy work queue */
-		cancel_delayed_work(&lmac->dwork);
-		flush_workqueue(lmac->check_link);
+		cancel_delayed_work_sync(&lmac->dwork);
 		destroy_workqueue(lmac->check_link);
 	}
 
Signature · 1 line
1.7.1