Skip to content

Commit

Permalink
Merge branch 'Fix-bugs-in-Octeontx2-netdev-driver'
Browse files Browse the repository at this point in the history
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 <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jul 29, 2020
2 parents 3cab8c6 + ed543f5 commit fa662d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1730,10 +1730,12 @@ static void otx2_reset_task(struct work_struct *work)
if (!netif_running(pf->netdev))
return;

rtnl_lock();
otx2_stop(pf->netdev);
pf->reset_count++;
otx2_open(pf->netdev);
netif_trans_update(pf->netdev);
rtnl_unlock();
}

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

pf = netdev_priv(netdev);

cancel_work_sync(&pf->reset_task);
/* Disable link notifications */
otx2_cgx_config_linkevents(pf, false);

Expand Down
2 changes: 2 additions & 0 deletions drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,8 @@ static void otx2vf_remove(struct pci_dev *pdev)

vf = netdev_priv(netdev);

cancel_work_sync(&vf->reset_task);
unregister_netdev(netdev);
otx2vf_disable_mbox_intr(vf);

otx2_detach_resources(&vf->mbox);
Expand Down

0 comments on commit fa662d7

Please sign in to comment.