aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Jurgens2017-01-10 14:33:39 -0600
committerDavid S. Miller2017-01-10 20:34:01 -0600
commit5e44fca5047054f1762813751626b5245e0da022 (patch)
tree4f4a80ffb789cf974cfc3e0457aeee5eac7a2622
parent0bbcc0a8fc394d01988fe0263ccf7fddb77a12c3 (diff)
downloadmkaricheri-ti-linux-kernel-5e44fca5047054f1762813751626b5245e0da022.tar.gz
mkaricheri-ti-linux-kernel-5e44fca5047054f1762813751626b5245e0da022.tar.xz
mkaricheri-ti-linux-kernel-5e44fca5047054f1762813751626b5245e0da022.zip
net/mlx5: Only cancel recovery work when cleaning up device
Do not attempt to drain the health workqueue when unloading the device in the recovery flow, this can cause a deadlock when the recovery work tries to cancel itself with sync. Because the work is no longer unconditionally canceled when unloading, it must be explicitly canceled in the AER flow. fixes: 689a248df83b ("net/mlx5: Cancel recovery work in remove flow") 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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index 6547f22e6b9b..d01e9f21d469 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -1195,7 +1195,8 @@ static int mlx5_unload_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv,
1195{ 1195{
1196 int err = 0; 1196 int err = 0;
1197 1197
1198 mlx5_drain_health_wq(dev); 1198 if (cleanup)
1199 mlx5_drain_health_wq(dev);
1199 1200
1200 mutex_lock(&dev->intf_state_mutex); 1201 mutex_lock(&dev->intf_state_mutex);
1201 if (test_bit(MLX5_INTERFACE_STATE_DOWN, &dev->intf_state)) { 1202 if (test_bit(MLX5_INTERFACE_STATE_DOWN, &dev->intf_state)) {
@@ -1359,9 +1360,10 @@ static pci_ers_result_t mlx5_pci_err_detected(struct pci_dev *pdev,
1359 1360
1360 mlx5_enter_error_state(dev); 1361 mlx5_enter_error_state(dev);
1361 mlx5_unload_one(dev, priv, false); 1362 mlx5_unload_one(dev, priv, false);
1362 /* In case of kernel call save the pci state */ 1363 /* In case of kernel call save the pci state and drain the health wq */
1363 if (state) { 1364 if (state) {
1364 pci_save_state(pdev); 1365 pci_save_state(pdev);
1366 mlx5_drain_health_wq(dev);
1365 mlx5_pci_disable_device(dev); 1367 mlx5_pci_disable_device(dev);
1366 } 1368 }
1367 1369