Skip to content

Commit

Permalink
net: thunderx: Wait for delayed work to finish before destroying it
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thanneeru Srinivasulu authored and David S. Miller committed Dec 2, 2015
1 parent 723cda5 commit a7b1f53
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions drivers/net/ethernet/cavium/thunder/nic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
3 changes: 1 addition & 2 deletions drivers/net/ethernet/cavium/thunder/thunder_bgx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit a7b1f53

Please sign in to comment.