Skip to content

Commit 948a663

Browse files
Subbaraya Sundeepdavem330
authored andcommitted
octeontx2-pf: Fix reset_task bugs
Two bugs exist in the code related to reset_task in PF driver one is the missing protection against network stack ndo_open and ndo_close. Other one is the missing cancel_work. This patch fixes those problems. Fixes: 4ff7d14 ("octeontx2-pf: Error handling support") Signed-off-by: Subbaraya Sundeep <[email protected]> Signed-off-by: Sunil Goutham <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3cab8c6 commit 948a663

File tree

1 file changed

+3
-0
lines changed
  • drivers/net/ethernet/marvell/octeontx2/nic

1 file changed

+3
-0
lines changed

drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,10 +1730,12 @@ static void otx2_reset_task(struct work_struct *work)
17301730
if (!netif_running(pf->netdev))
17311731
return;
17321732

1733+
rtnl_lock();
17331734
otx2_stop(pf->netdev);
17341735
pf->reset_count++;
17351736
otx2_open(pf->netdev);
17361737
netif_trans_update(pf->netdev);
1738+
rtnl_unlock();
17371739
}
17381740

17391741
static const struct net_device_ops otx2_netdev_ops = {
@@ -2111,6 +2113,7 @@ static void otx2_remove(struct pci_dev *pdev)
21112113

21122114
pf = netdev_priv(netdev);
21132115

2116+
cancel_work_sync(&pf->reset_task);
21142117
/* Disable link notifications */
21152118
otx2_cgx_config_linkevents(pf, false);
21162119

0 commit comments

Comments
 (0)