aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Jurgens <danielj@mellanox.com>2016-12-28 07:58:33 -0500
committerDavid S. Miller <davem@davemloft.net>2016-12-28 14:36:50 -0500
commit689a248df83b6032edc57e86267b4e5cc8d7174e (patch)
tree973f7775bcd538554b67c42cbb646a531741564b
parent883371c453b937f9eb581fb4915210865982736f (diff)
net/mlx5: Cancel recovery work in remove flow
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>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/main.c5
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 23c12f1aaa39..0b49739eadd3 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -1196,6 +1196,8 @@ static int mlx5_unload_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv,
1196{ 1196{
1197 int err = 0; 1197 int err = 0;
1198 1198
1199 mlx5_drain_health_wq(dev);
1200
1199 mutex_lock(&dev->intf_state_mutex); 1201 mutex_lock(&dev->intf_state_mutex);
1200 if (test_bit(MLX5_INTERFACE_STATE_DOWN, &dev->intf_state)) { 1202 if (test_bit(MLX5_INTERFACE_STATE_DOWN, &dev->intf_state)) {
1201 dev_warn(&dev->pdev->dev, "%s: interface is down, NOP\n", 1203 dev_warn(&dev->pdev->dev, "%s: interface is down, NOP\n",
@@ -1358,10 +1360,9 @@ static pci_ers_result_t mlx5_pci_err_detected(struct pci_dev *pdev,
1358 1360
1359 mlx5_enter_error_state(dev); 1361 mlx5_enter_error_state(dev);
1360 mlx5_unload_one(dev, priv, false); 1362 mlx5_unload_one(dev, priv, false);
1361 /* In case of kernel call save the pci state and drain health wq */ 1363 /* In case of kernel call save the pci state */
1362 if (state) { 1364 if (state) {
1363 pci_save_state(pdev); 1365 pci_save_state(pdev);
1364 mlx5_drain_health_wq(dev);
1365 mlx5_pci_disable_device(dev); 1366 mlx5_pci_disable_device(dev);
1366 } 1367 }
1367 1368