Skip to content

Commit

Permalink
net/mlx5e: Take state lock during tx timeout reporter
Browse files Browse the repository at this point in the history
mlx5e_safe_reopen_channels() requires the state lock taken. The
referenced changed in the Fixes tag removed the lock to fix another
issue. This patch adds it back but at a later point (when calling
mlx5e_safe_reopen_channels()) to avoid the deadlock referenced in the
Fixes tag.

Fixes: eab0da3 ("net/mlx5e: Fix possible deadlock on mlx5e_tx_timeout_work")
Signed-off-by: Dragos Tatulea <[email protected]>
Link: https://lore.kernel.org/all/[email protected]/T/
Reviewed-by: Breno Leitao <[email protected]>
Reviewed-by: Moshe Shemesh <[email protected]>
Signed-off-by: Tariq Toukan <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
dtatulea authored and kuba-moo committed Aug 10, 2024
1 parent ab6013a commit e6b5afd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ static int mlx5e_tx_reporter_timeout_recover(void *ctx)
return err;
}

mutex_lock(&priv->state_lock);
err = mlx5e_safe_reopen_channels(priv);
mutex_unlock(&priv->state_lock);
if (!err) {
to_ctx->status = 1; /* all channels recovered */
return err;
Expand Down

0 comments on commit e6b5afd

Please sign in to comment.