Skip to content

Commit fa662d7

Browse files
committed
Merge branch 'Fix-bugs-in-Octeontx2-netdev-driver'
Subbaraya Sundeep says: ==================== Fix bugs in Octeontx2 netdev driver There are problems in the existing Octeontx2 netdev drivers like missing cancel_work for the reset task, missing lock in reset task and missing unergister_netdev in driver remove. This patch set fixes the above problems. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 3cab8c6 + ed543f5 commit fa662d7

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-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

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,8 @@ static void otx2vf_remove(struct pci_dev *pdev)
617617

618618
vf = netdev_priv(netdev);
619619

620+
cancel_work_sync(&vf->reset_task);
621+
unregister_netdev(netdev);
620622
otx2vf_disable_mbox_intr(vf);
621623

622624
otx2_detach_resources(&vf->mbox);

0 commit comments

Comments
 (0)