aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r--drivers/infiniband/hw/ehca/ehca_qp.c2
-rw-r--r--drivers/infiniband/hw/ipath/ipath_qp.c2
-rw-r--r--drivers/infiniband/hw/mlx4/qp.c9
-rw-r--r--drivers/infiniband/hw/mlx5/qp.c3
-rw-r--r--drivers/infiniband/hw/mthca/mthca_qp.c3
-rw-r--r--drivers/infiniband/hw/ocrdma/ocrdma_verbs.c3
-rw-r--r--drivers/infiniband/hw/qib/qib_qp.c2
7 files changed, 16 insertions, 8 deletions
diff --git a/drivers/infiniband/hw/ehca/ehca_qp.c b/drivers/infiniband/hw/ehca/ehca_qp.c
index 00d6861a6a18..2e89356c46fa 100644
--- a/drivers/infiniband/hw/ehca/ehca_qp.c
+++ b/drivers/infiniband/hw/ehca/ehca_qp.c
@@ -1329,7 +1329,7 @@ static int internal_modify_qp(struct ib_qp *ibqp,
1329 qp_new_state = attr_mask & IB_QP_STATE ? attr->qp_state : qp_cur_state; 1329 qp_new_state = attr_mask & IB_QP_STATE ? attr->qp_state : qp_cur_state;
1330 if (!smi_reset2init && 1330 if (!smi_reset2init &&
1331 !ib_modify_qp_is_ok(qp_cur_state, qp_new_state, ibqp->qp_type, 1331 !ib_modify_qp_is_ok(qp_cur_state, qp_new_state, ibqp->qp_type,
1332 attr_mask)) { 1332 attr_mask, IB_LINK_LAYER_UNSPECIFIED)) {
1333 ret = -EINVAL; 1333 ret = -EINVAL;
1334 ehca_err(ibqp->device, 1334 ehca_err(ibqp->device,
1335 "Invalid qp transition new_state=%x cur_state=%x " 1335 "Invalid qp transition new_state=%x cur_state=%x "
diff --git a/drivers/infiniband/hw/ipath/ipath_qp.c b/drivers/infiniband/hw/ipath/ipath_qp.c
index 0857a9c3cd3d..face87602dc1 100644
--- a/drivers/infiniband/hw/ipath/ipath_qp.c
+++ b/drivers/infiniband/hw/ipath/ipath_qp.c
@@ -463,7 +463,7 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
463 new_state = attr_mask & IB_QP_STATE ? attr->qp_state : cur_state; 463 new_state = attr_mask & IB_QP_STATE ? attr->qp_state : cur_state;
464 464
465 if (!ib_modify_qp_is_ok(cur_state, new_state, ibqp->qp_type, 465 if (!ib_modify_qp_is_ok(cur_state, new_state, ibqp->qp_type,
466 attr_mask)) 466 attr_mask, IB_LINK_LAYER_UNSPECIFIED))
467 goto inval; 467 goto inval;
468 468
469 if (attr_mask & IB_QP_AV) { 469 if (attr_mask & IB_QP_AV) {
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index 4f10af2905b5..da6f5fa0c328 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -1561,13 +1561,18 @@ int mlx4_ib_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
1561 struct mlx4_ib_qp *qp = to_mqp(ibqp); 1561 struct mlx4_ib_qp *qp = to_mqp(ibqp);
1562 enum ib_qp_state cur_state, new_state; 1562 enum ib_qp_state cur_state, new_state;
1563 int err = -EINVAL; 1563 int err = -EINVAL;
1564 1564 int p = attr_mask & IB_QP_PORT ? attr->port_num : qp->port;
1565 mutex_lock(&qp->mutex); 1565 mutex_lock(&qp->mutex);
1566 1566
1567 cur_state = attr_mask & IB_QP_CUR_STATE ? attr->cur_qp_state : qp->state; 1567 cur_state = attr_mask & IB_QP_CUR_STATE ? attr->cur_qp_state : qp->state;
1568 new_state = attr_mask & IB_QP_STATE ? attr->qp_state : cur_state; 1568 new_state = attr_mask & IB_QP_STATE ? attr->qp_state : cur_state;
1569 1569
1570 if (!ib_modify_qp_is_ok(cur_state, new_state, ibqp->qp_type, attr_mask)) { 1570 if (cur_state == new_state && cur_state == IB_QPS_RESET)
1571 p = IB_LINK_LAYER_UNSPECIFIED;
1572
1573 if (!ib_modify_qp_is_ok(cur_state, new_state, ibqp->qp_type,
1574 attr_mask,
1575 rdma_port_get_link_layer(&dev->ib_dev, p))) {
1571 pr_debug("qpn 0x%x: invalid attribute mask specified " 1576 pr_debug("qpn 0x%x: invalid attribute mask specified "
1572 "for transition %d to %d. qp_type %d," 1577 "for transition %d to %d. qp_type %d,"
1573 " attr_mask 0x%x\n", 1578 " attr_mask 0x%x\n",
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index 7c6b4ba49bec..ca2936233713 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -1616,7 +1616,8 @@ int mlx5_ib_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
1616 new_state = attr_mask & IB_QP_STATE ? attr->qp_state : cur_state; 1616 new_state = attr_mask & IB_QP_STATE ? attr->qp_state : cur_state;
1617 1617
1618 if (ibqp->qp_type != MLX5_IB_QPT_REG_UMR && 1618 if (ibqp->qp_type != MLX5_IB_QPT_REG_UMR &&
1619 !ib_modify_qp_is_ok(cur_state, new_state, ibqp->qp_type, attr_mask)) 1619 !ib_modify_qp_is_ok(cur_state, new_state, ibqp->qp_type, attr_mask,
1620 IB_LINK_LAYER_UNSPECIFIED))
1620 goto out; 1621 goto out;
1621 1622
1622 if ((attr_mask & IB_QP_PORT) && 1623 if ((attr_mask & IB_QP_PORT) &&
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c
index 26a684536109..e354b2f04ad9 100644
--- a/drivers/infiniband/hw/mthca/mthca_qp.c
+++ b/drivers/infiniband/hw/mthca/mthca_qp.c
@@ -860,7 +860,8 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask,
860 860
861 new_state = attr_mask & IB_QP_STATE ? attr->qp_state : cur_state; 861 new_state = attr_mask & IB_QP_STATE ? attr->qp_state : cur_state;
862 862
863 if (!ib_modify_qp_is_ok(cur_state, new_state, ibqp->qp_type, attr_mask)) { 863 if (!ib_modify_qp_is_ok(cur_state, new_state, ibqp->qp_type, attr_mask,
864 IB_LINK_LAYER_UNSPECIFIED)) {
864 mthca_dbg(dev, "Bad QP transition (transport %d) " 865 mthca_dbg(dev, "Bad QP transition (transport %d) "
865 "%d->%d with attr 0x%08x\n", 866 "%d->%d with attr 0x%08x\n",
866 qp->transport, cur_state, new_state, 867 qp->transport, cur_state, new_state,
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
index 7686dceadd29..a0f1c47c333f 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
@@ -1326,7 +1326,8 @@ int ocrdma_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
1326 new_qps = old_qps; 1326 new_qps = old_qps;
1327 spin_unlock_irqrestore(&qp->q_lock, flags); 1327 spin_unlock_irqrestore(&qp->q_lock, flags);
1328 1328
1329 if (!ib_modify_qp_is_ok(old_qps, new_qps, ibqp->qp_type, attr_mask)) { 1329 if (!ib_modify_qp_is_ok(old_qps, new_qps, ibqp->qp_type, attr_mask,
1330 IB_LINK_LAYER_UNSPECIFIED)) {
1330 pr_err("%s(%d) invalid attribute mask=0x%x specified for\n" 1331 pr_err("%s(%d) invalid attribute mask=0x%x specified for\n"
1331 "qpn=0x%x of type=0x%x old_qps=0x%x, new_qps=0x%x\n", 1332 "qpn=0x%x of type=0x%x old_qps=0x%x, new_qps=0x%x\n",
1332 __func__, dev->id, attr_mask, qp->id, ibqp->qp_type, 1333 __func__, dev->id, attr_mask, qp->id, ibqp->qp_type,
diff --git a/drivers/infiniband/hw/qib/qib_qp.c b/drivers/infiniband/hw/qib/qib_qp.c
index 3cca55b51e54..0cad0c40d742 100644
--- a/drivers/infiniband/hw/qib/qib_qp.c
+++ b/drivers/infiniband/hw/qib/qib_qp.c
@@ -585,7 +585,7 @@ int qib_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
585 new_state = attr_mask & IB_QP_STATE ? attr->qp_state : cur_state; 585 new_state = attr_mask & IB_QP_STATE ? attr->qp_state : cur_state;
586 586
587 if (!ib_modify_qp_is_ok(cur_state, new_state, ibqp->qp_type, 587 if (!ib_modify_qp_is_ok(cur_state, new_state, ibqp->qp_type,
588 attr_mask)) 588 attr_mask, IB_LINK_LAYER_UNSPECIFIED))
589 goto inval; 589 goto inval;
590 590
591 if (attr_mask & IB_QP_AV) { 591 if (attr_mask & IB_QP_AV) {