Commit adc100d0 authored by Igor Russkikh's avatar Igor Russkikh Committed by David S. Miller

qede: make driver reliable on unload after failures

In case recovery was not successful, netdev still should be
present. But we should clear cdev if something bad happens
on recovery.

We also check cdev for null on dev close. That could be a case
if recovery was not successful.
Signed-off-by: default avatarIgor Russkikh <irusskikh@marvell.com>
Signed-off-by: default avatarAlexander Lobakin <alobakin@marvell.com>
Signed-off-by: default avatarMichal Kalderon <michal.kalderon@marvell.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c5c642c5
...@@ -1238,7 +1238,10 @@ static int __qede_probe(struct pci_dev *pdev, u32 dp_module, u8 dp_level, ...@@ -1238,7 +1238,10 @@ static int __qede_probe(struct pci_dev *pdev, u32 dp_module, u8 dp_level,
err4: err4:
qede_rdma_dev_remove(edev, (mode == QEDE_PROBE_RECOVERY)); qede_rdma_dev_remove(edev, (mode == QEDE_PROBE_RECOVERY));
err3: err3:
if (mode != QEDE_PROBE_RECOVERY)
free_netdev(edev->ndev); free_netdev(edev->ndev);
else
edev->cdev = NULL;
err2: err2:
qed_ops->common->slowpath_stop(cdev); qed_ops->common->slowpath_stop(cdev);
err1: err1:
...@@ -2473,6 +2476,7 @@ static int qede_close(struct net_device *ndev) ...@@ -2473,6 +2476,7 @@ static int qede_close(struct net_device *ndev)
qede_unload(edev, QEDE_UNLOAD_NORMAL, false); qede_unload(edev, QEDE_UNLOAD_NORMAL, false);
if (edev->cdev)
edev->ops->common->update_drv_state(edev->cdev, false); edev->ops->common->update_drv_state(edev->cdev, false);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment