Skip to content

Commit

Permalink
octeontx2-pf: Unregister netdev at driver remove
Browse files Browse the repository at this point in the history
Added unregister_netdev in the driver remove
function. Generally unregister_netdev is called
after disabling all the device interrupts but here
it is called before disabling device mailbox
interrupts. The reason behind this is VF needs
mailbox interrupt to communicate with its PF to
clean up its resources during otx2_stop.
otx2_stop disables packet I/O and queue interrupts
first and by using mailbox interrupt communicates
to PF to free VF resources. Hence this patch
calls unregister_device just before
disabling mailbox interrupts.

Fixes: 3184fb5 ("octeontx2-vf: Virtual function driver support")
Signed-off-by: Subbaraya Sundeep <[email protected]>
Signed-off-by: Sunil Goutham <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Subbaraya Sundeep authored and davem330 committed Jul 29, 2020
1 parent c0376f4 commit ed543f5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ 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 ed543f5

Please sign in to comment.