[PATCH rdma-next 2/9] RDMA/mlx5: Don't let a slave port mark its master active
From: Edward Srouji
Date: Sun Nov 22 2026 - 12:40:03 EST
mlx5r_mp_probe() sets ib_active on the master a slave port binds to.
Commit 97f30d324ce6 ("RDMA/mlx5: Recover from fatal event in dual port
mode") added that because a fatal event on the slave port used to
clear the master's ib_active. Since commit ebc2164a4cd4 ("RDMA/mlx5:
Fix UMR hang in LAG error state unload") system errors are handled by
a notifier on the master's own core device, and an error on the slave
no longer deactivates the master.
A master is on mlx5_ib_dev_list from MLX5_IB_STAGE_INIT until its
cleanup, while its ib_active is set only once probe completes, and a
slave port can bind to it at any point in between, as binding only
needs a free port slot. Setting ib_active on bind can then activate a
master that is still probing, is being removed or has failed, so that
events are handled for a device that is not registered yet or is being
torn down. Remove it.
The bind itself, and the rdma_roce_rescan_device() that follows it, can
still race a master that is probing or being removed; that is a
separate problem and is not addressed here.
Fixes: 97f30d324ce6 ("RDMA/mlx5: Recover from fatal event in dual port mode")
Reviewed-by: Michael Gur <michaelgur@xxxxxxxxxx>
Signed-off-by: Edward Srouji <edwards@xxxxxxxxxx>
---
drivers/infiniband/hw/mlx5/main.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 789e17bd317a48db502937a6816e95aa22f48e6f..4504ba112034f4a5cfad16183602f209941c8835 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -5297,7 +5297,6 @@ static int mlx5r_mp_probe(struct auxiliary_device *adev,
if (bound) {
rdma_roce_rescan_device(&dev->ib_dev);
- mpi->ibdev->ib_active = true;
break;
}
}
--
2.49.0