diff options
author | Mintz, Yuval <Yuval.Mintz@cavium.com> | 2017-02-20 23:43:35 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-02-21 01:11:54 +0300 |
commit | 885185dfc49bde35b45046bb6b7384eca68e404f (patch) | |
tree | 298b4f0bb0b866cb7498d04e2ae947bef41c8221 | |
parent | 0e0b80a9a7181cbdbb965a6b4750574932106e31 (diff) | |
download | linux-885185dfc49bde35b45046bb6b7384eca68e404f.tar.xz |
qede: Free netdevice only after stoping slowpath
qed needs to be informed of the removal of the qede interface
prior to its actual removal, as qede has some registered callbacks
that might get called async to the removal flow.
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/qlogic/qede/qede_main.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c index 7a8e07d0e01c..88453ed1a5bf 100644 --- a/drivers/net/ethernet/qlogic/qede/qede_main.c +++ b/drivers/net/ethernet/qlogic/qede/qede_main.c @@ -956,14 +956,20 @@ static void __qede_remove(struct pci_dev *pdev, enum qede_remove_mode mode) if (edev->xdp_prog) bpf_prog_put(edev->xdp_prog); - free_netdev(ndev); - /* Use global ops since we've freed edev */ qed_ops->common->slowpath_stop(cdev); if (system_state == SYSTEM_POWER_OFF) return; qed_ops->common->remove(cdev); + /* Since this can happen out-of-sync with other flows, + * don't release the netdevice until after slowpath stop + * has been called to guarantee various other contexts + * [e.g., QED register callbacks] won't break anything when + * accessing the netdevice. + */ + free_netdev(ndev); + dev_info(&pdev->dev, "Ending qede_remove successfully\n"); } |