summaryrefslogtreecommitdiffstats
path: root/sys/dev/mlx5/mlx5_core/mlx5_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/mlx5/mlx5_core/mlx5_main.c')
-rw-r--r--sys/dev/mlx5/mlx5_core/mlx5_main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/mlx5/mlx5_core/mlx5_main.c b/sys/dev/mlx5/mlx5_core/mlx5_main.c
index ddf70c3..a8ac5b8 100644
--- a/sys/dev/mlx5/mlx5_core/mlx5_main.c
+++ b/sys/dev/mlx5/mlx5_core/mlx5_main.c
@@ -1243,7 +1243,12 @@ static pci_ers_result_t mlx5_pci_err_detected(struct pci_dev *pdev,
dev_info(&pdev->dev, "%s was called\n", __func__);
mlx5_enter_error_state(dev);
mlx5_unload_one(dev, priv);
- mlx5_pci_disable_device(dev);
+ if (state) {
+ pci_save_state(pdev->dev.bsddev);
+ mlx5_drain_health_wq(dev);
+ mlx5_pci_disable_device(dev);
+ }
+
return state == pci_channel_io_perm_failure ?
PCI_ERS_RESULT_DISCONNECT : PCI_ERS_RESULT_NEED_RESET;
}
OpenPOWER on IntegriCloud