diff options
author | Daniel Jurgens <danielj@mellanox.com> | 2016-12-28 14:58:33 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-01-15 13:42:53 +0100 |
commit | ca8a64467f2a20f86218c483c03fb7fc8c33c156 (patch) | |
tree | c6b6a71c17295fff645a8b4dc543432d2690a4df /drivers/net | |
parent | 7bf1de7f2749ad858c33d3133240d5c3df046658 (diff) | |
download | linux-rpi3-ca8a64467f2a20f86218c483c03fb7fc8c33c156.tar.gz linux-rpi3-ca8a64467f2a20f86218c483c03fb7fc8c33c156.tar.bz2 linux-rpi3-ca8a64467f2a20f86218c483c03fb7fc8c33c156.zip |
net/mlx5: Cancel recovery work in remove flow
[ Upstream commit 689a248df83b6032edc57e86267b4e5cc8d7174e ]
If there is pending delayed work for health recovery it must be canceled
if the device is being unloaded.
Fixes: 05ac2c0b7438 ("net/mlx5: Fix race between PCI error handlers and health work")
Signed-off-by: Daniel Jurgens <danielj@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/main.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index 332769cde9f4..15b7e600bf9b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c @@ -1159,6 +1159,8 @@ static int mlx5_unload_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv, { int err = 0; + mlx5_drain_health_wq(dev); + mutex_lock(&dev->intf_state_mutex); if (test_bit(MLX5_INTERFACE_STATE_DOWN, &dev->intf_state)) { dev_warn(&dev->pdev->dev, "%s: interface is down, NOP\n", @@ -1319,10 +1321,9 @@ static pci_ers_result_t mlx5_pci_err_detected(struct pci_dev *pdev, mlx5_enter_error_state(dev); mlx5_unload_one(dev, priv, false); - /* In case of kernel call save the pci state and drain health wq */ + /* In case of kernel call save the pci state */ if (state) { pci_save_state(pdev); - mlx5_drain_health_wq(dev); mlx5_pci_disable_device(dev); } |