Skip to content

Commit 2bf5dd7

Browse files
committed
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
Pull rdma fixes from Jason Gunthorpe: - Add a missing mutex_destroy() in rxe - Enhance the debugging print for cm_destroy failures to help debug these - Fix mlx5 MAD processing in cases where multiport devices are running in switchedev mode * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: RDMA/mlx5: Fix port number for counter query in multi-port configuration RDMA/cm: Print the old state when cm_destroy_id gets timeout RDMA/rxe: Fix the problem "mutex_destroy missing"
2 parents 46b2850 + be121ff commit 2bf5dd7

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

drivers/infiniband/core/cm.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,23 +1026,26 @@ static void cm_reset_to_idle(struct cm_id_private *cm_id_priv)
10261026
}
10271027
}
10281028

1029-
static noinline void cm_destroy_id_wait_timeout(struct ib_cm_id *cm_id)
1029+
static noinline void cm_destroy_id_wait_timeout(struct ib_cm_id *cm_id,
1030+
enum ib_cm_state old_state)
10301031
{
10311032
struct cm_id_private *cm_id_priv;
10321033

10331034
cm_id_priv = container_of(cm_id, struct cm_id_private, id);
1034-
pr_err("%s: cm_id=%p timed out. state=%d refcnt=%d\n", __func__,
1035-
cm_id, cm_id->state, refcount_read(&cm_id_priv->refcount));
1035+
pr_err("%s: cm_id=%p timed out. state %d -> %d, refcnt=%d\n", __func__,
1036+
cm_id, old_state, cm_id->state, refcount_read(&cm_id_priv->refcount));
10361037
}
10371038

10381039
static void cm_destroy_id(struct ib_cm_id *cm_id, int err)
10391040
{
10401041
struct cm_id_private *cm_id_priv;
1042+
enum ib_cm_state old_state;
10411043
struct cm_work *work;
10421044
int ret;
10431045

10441046
cm_id_priv = container_of(cm_id, struct cm_id_private, id);
10451047
spin_lock_irq(&cm_id_priv->lock);
1048+
old_state = cm_id->state;
10461049
retest:
10471050
switch (cm_id->state) {
10481051
case IB_CM_LISTEN:
@@ -1151,7 +1154,7 @@ static void cm_destroy_id(struct ib_cm_id *cm_id, int err)
11511154
msecs_to_jiffies(
11521155
CM_DESTROY_ID_WAIT_TIMEOUT));
11531156
if (!ret) /* timeout happened */
1154-
cm_destroy_id_wait_timeout(cm_id);
1157+
cm_destroy_id_wait_timeout(cm_id, old_state);
11551158
} while (!ret);
11561159

11571160
while ((work = cm_dequeue_work(cm_id_priv)) != NULL)

drivers/infiniband/hw/mlx5/mad.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ static int process_pma_cmd(struct mlx5_ib_dev *dev, u32 port_num,
188188
mdev = dev->mdev;
189189
mdev_port_num = 1;
190190
}
191-
if (MLX5_CAP_GEN(dev->mdev, num_ports) == 1) {
191+
if (MLX5_CAP_GEN(dev->mdev, num_ports) == 1 &&
192+
!mlx5_core_mp_enabled(mdev)) {
192193
/* set local port to one for Function-Per-Port HCA. */
193194
mdev = dev->mdev;
194195
mdev_port_num = 1;

drivers/infiniband/sw/rxe/rxe.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ void rxe_dealloc(struct ib_device *ib_dev)
3333

3434
if (rxe->tfm)
3535
crypto_free_shash(rxe->tfm);
36+
37+
mutex_destroy(&rxe->usdev_lock);
3638
}
3739

3840
/* initialize rxe device parameters */

0 commit comments

Comments
 (0)