Skip to content

Commit 1c2940e

Browse files
Cosmin Ratiukuba-moo
authored andcommitted
net/mlx5e: Fix lock order in mlx5e_tx_reporter_ptpsq_unhealthy_recover
RTNL needs to be acquired before state_lock. Fixes: fdce06b ("net/mlx5e: Acquire RTNL lock before RQs/SQs activation/deactivation") Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com> Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com> Signed-off-by: Mark Bloch <mbloch@nvidia.com> Link: https://patch.msgid.link/20250423083611.324567-5-mbloch@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 172c034 commit 1c2940e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,29 +176,27 @@ static int mlx5e_tx_reporter_ptpsq_unhealthy_recover(void *ctx)
176176

177177
priv = ptpsq->txqsq.priv;
178178

179+
rtnl_lock();
179180
mutex_lock(&priv->state_lock);
180181
chs = &priv->channels;
181182
netdev = priv->netdev;
182183

183184
carrier_ok = netif_carrier_ok(netdev);
184185
netif_carrier_off(netdev);
185186

186-
rtnl_lock();
187187
mlx5e_deactivate_priv_channels(priv);
188-
rtnl_unlock();
189188

190189
mlx5e_ptp_close(chs->ptp);
191190
err = mlx5e_ptp_open(priv, &chs->params, chs->c[0]->lag_port, &chs->ptp);
192191

193-
rtnl_lock();
194192
mlx5e_activate_priv_channels(priv);
195-
rtnl_unlock();
196193

197194
/* return carrier back if needed */
198195
if (carrier_ok)
199196
netif_carrier_on(netdev);
200197

201198
mutex_unlock(&priv->state_lock);
199+
rtnl_unlock();
202200

203201
return err;
204202
}

0 commit comments

Comments
 (0)