diff options
author | Daniel Jurgens <danielj@mellanox.com> | 2017-01-10 15:33:39 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-01-19 14:18:04 -0500 |
commit | ce31072b43426e3bf45bc490e93504f5746cb9b5 (patch) | |
tree | 3658c5da42c3f01dc1e11d9b45d03bc0f24d81cb | |
parent | 2f946414a080e8f516d267a6722f38104699efd1 (diff) |
net/mlx5: Only cancel recovery work when cleaning up device
commit 5e44fca5047054f1762813751626b5245e0da022 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/main.c | 6 |
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 92bd13ddc39d..0c9ef8729ca7 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c | |||
@@ -1158,7 +1158,8 @@ static int mlx5_unload_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv, | |||
1158 | { | 1158 | { |
1159 | int err = 0; | 1159 | int err = 0; |
1160 | 1160 | ||
1161 | mlx5_drain_health_wq(dev); | 1161 | if (cleanup) |
1162 | mlx5_drain_health_wq(dev); | ||
1162 | 1163 | ||
1163 | mutex_lock(&dev->intf_state_mutex); | 1164 | mutex_lock(&dev->intf_state_mutex); |
1164 | if (test_bit(MLX5_INTERFACE_STATE_DOWN, &dev->intf_state)) { | 1165 | if (test_bit(MLX5_INTERFACE_STATE_DOWN, &dev->intf_state)) { |
@@ -1320,9 +1321,10 @@ static pci_ers_result_t mlx5_pci_err_detected(struct pci_dev *pdev, | |||
1320 | 1321 | ||
1321 | mlx5_enter_error_state(dev); | 1322 | mlx5_enter_error_state(dev); |
1322 | mlx5_unload_one(dev, priv, false); | 1323 | mlx5_unload_one(dev, priv, false); |
1323 | /* In case of kernel call save the pci state */ | 1324 | /* In case of kernel call save the pci state and drain the health wq */ |
1324 | if (state) { | 1325 | if (state) { |
1325 | pci_save_state(pdev); | 1326 | pci_save_state(pdev); |
1327 | mlx5_drain_health_wq(dev); | ||
1326 | mlx5_pci_disable_device(dev); | 1328 | mlx5_pci_disable_device(dev); |
1327 | } | 1329 | } |
1328 | 1330 | ||