Commit 2bf5dd7c authored by Linus Torvalds's avatar Linus Torvalds

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"
parents 46b28503 be121ffb
...@@ -1026,23 +1026,26 @@ static void cm_reset_to_idle(struct cm_id_private *cm_id_priv) ...@@ -1026,23 +1026,26 @@ static void cm_reset_to_idle(struct cm_id_private *cm_id_priv)
} }
} }
static noinline void cm_destroy_id_wait_timeout(struct ib_cm_id *cm_id) static noinline void cm_destroy_id_wait_timeout(struct ib_cm_id *cm_id,
enum ib_cm_state old_state)
{ {
struct cm_id_private *cm_id_priv; struct cm_id_private *cm_id_priv;
cm_id_priv = container_of(cm_id, struct cm_id_private, id); cm_id_priv = container_of(cm_id, struct cm_id_private, id);
pr_err("%s: cm_id=%p timed out. state=%d refcnt=%d\n", __func__, pr_err("%s: cm_id=%p timed out. state %d -> %d, refcnt=%d\n", __func__,
cm_id, cm_id->state, refcount_read(&cm_id_priv->refcount)); cm_id, old_state, cm_id->state, refcount_read(&cm_id_priv->refcount));
} }
static void cm_destroy_id(struct ib_cm_id *cm_id, int err) static void cm_destroy_id(struct ib_cm_id *cm_id, int err)
{ {
struct cm_id_private *cm_id_priv; struct cm_id_private *cm_id_priv;
enum ib_cm_state old_state;
struct cm_work *work; struct cm_work *work;
int ret; int ret;
cm_id_priv = container_of(cm_id, struct cm_id_private, id); cm_id_priv = container_of(cm_id, struct cm_id_private, id);
spin_lock_irq(&cm_id_priv->lock); spin_lock_irq(&cm_id_priv->lock);
old_state = cm_id->state;
retest: retest:
switch (cm_id->state) { switch (cm_id->state) {
case IB_CM_LISTEN: case IB_CM_LISTEN:
...@@ -1151,7 +1154,7 @@ static void cm_destroy_id(struct ib_cm_id *cm_id, int err) ...@@ -1151,7 +1154,7 @@ static void cm_destroy_id(struct ib_cm_id *cm_id, int err)
msecs_to_jiffies( msecs_to_jiffies(
CM_DESTROY_ID_WAIT_TIMEOUT)); CM_DESTROY_ID_WAIT_TIMEOUT));
if (!ret) /* timeout happened */ if (!ret) /* timeout happened */
cm_destroy_id_wait_timeout(cm_id); cm_destroy_id_wait_timeout(cm_id, old_state);
} while (!ret); } while (!ret);
while ((work = cm_dequeue_work(cm_id_priv)) != NULL) while ((work = cm_dequeue_work(cm_id_priv)) != NULL)
......
...@@ -188,7 +188,8 @@ static int process_pma_cmd(struct mlx5_ib_dev *dev, u32 port_num, ...@@ -188,7 +188,8 @@ static int process_pma_cmd(struct mlx5_ib_dev *dev, u32 port_num,
mdev = dev->mdev; mdev = dev->mdev;
mdev_port_num = 1; mdev_port_num = 1;
} }
if (MLX5_CAP_GEN(dev->mdev, num_ports) == 1) { if (MLX5_CAP_GEN(dev->mdev, num_ports) == 1 &&
!mlx5_core_mp_enabled(mdev)) {
/* set local port to one for Function-Per-Port HCA. */ /* set local port to one for Function-Per-Port HCA. */
mdev = dev->mdev; mdev = dev->mdev;
mdev_port_num = 1; mdev_port_num = 1;
......
...@@ -33,6 +33,8 @@ void rxe_dealloc(struct ib_device *ib_dev) ...@@ -33,6 +33,8 @@ void rxe_dealloc(struct ib_device *ib_dev)
if (rxe->tfm) if (rxe->tfm)
crypto_free_shash(rxe->tfm); crypto_free_shash(rxe->tfm);
mutex_destroy(&rxe->usdev_lock);
} }
/* initialize rxe device parameters */ /* initialize rxe device parameters */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment