[SRU][N:linux-bluefield][PATCH v1 3/4] net/mlx5e: Fix lock order in mlx5e_tx_reporter_ptpsq_unhealthy_recover
Stav Aviram
saviram at nvidia.com
Mon Oct 6 09:43:17 UTC 2025
From: Cosmin Ratiu <cratiu at nvidia.com>
BugLink: https://bugs.launchpad.net/bugs/2126876
RTNL needs to be acquired before state_lock.
Fixes: fdce06bda7e5 ("net/mlx5e: Acquire RTNL lock before RQs/SQs activation/deactivation")
Signed-off-by: Cosmin Ratiu <cratiu at nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea at nvidia.com>
Signed-off-by: Mark Bloch <mbloch at nvidia.com>
Link: https://patch.msgid.link/20250423083611.324567-5-mbloch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba at kernel.org>
(cherry picked from commit 1c2940ec0ddf51c689ee9ab85ead85c11b77809d)
Signed-off-by: Stav Aviram <saviram at nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
index ec5bb09d94e9..c70a19ea524d 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
@@ -173,6 +173,7 @@ static int mlx5e_tx_reporter_ptpsq_unhealthy_recover(void *ctx)
priv = ptpsq->txqsq.priv;
+ rtnl_lock();
mutex_lock(&priv->state_lock);
chs = &priv->channels;
netdev = priv->netdev;
@@ -192,6 +193,7 @@ static int mlx5e_tx_reporter_ptpsq_unhealthy_recover(void *ctx)
netif_carrier_on(netdev);
mutex_unlock(&priv->state_lock);
+ rtnl_unlock();
return err;
}
--
2.38.1
More information about the kernel-team
mailing list