diff options
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_qp.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c index 490fc783bb0c..cd8b6721ac9c 100644 --- a/drivers/infiniband/hw/mthca/mthca_qp.c +++ b/drivers/infiniband/hw/mthca/mthca_qp.c | |||
@@ -222,9 +222,8 @@ static void *get_send_wqe(struct mthca_qp *qp, int n) | |||
222 | (PAGE_SIZE - 1)); | 222 | (PAGE_SIZE - 1)); |
223 | } | 223 | } |
224 | 224 | ||
225 | static void mthca_wq_init(struct mthca_wq *wq) | 225 | static void mthca_wq_reset(struct mthca_wq *wq) |
226 | { | 226 | { |
227 | /* mthca_alloc_qp_common() initializes the locks */ | ||
228 | wq->next_ind = 0; | 227 | wq->next_ind = 0; |
229 | wq->last_comp = wq->max - 1; | 228 | wq->last_comp = wq->max - 1; |
230 | wq->head = 0; | 229 | wq->head = 0; |
@@ -845,10 +844,10 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask) | |||
845 | mthca_cq_clean(dev, to_mcq(qp->ibqp.recv_cq), qp->qpn, | 844 | mthca_cq_clean(dev, to_mcq(qp->ibqp.recv_cq), qp->qpn, |
846 | qp->ibqp.srq ? to_msrq(qp->ibqp.srq) : NULL); | 845 | qp->ibqp.srq ? to_msrq(qp->ibqp.srq) : NULL); |
847 | 846 | ||
848 | mthca_wq_init(&qp->sq); | 847 | mthca_wq_reset(&qp->sq); |
849 | qp->sq.last = get_send_wqe(qp, qp->sq.max - 1); | 848 | qp->sq.last = get_send_wqe(qp, qp->sq.max - 1); |
850 | 849 | ||
851 | mthca_wq_init(&qp->rq); | 850 | mthca_wq_reset(&qp->rq); |
852 | qp->rq.last = get_recv_wqe(qp, qp->rq.max - 1); | 851 | qp->rq.last = get_recv_wqe(qp, qp->rq.max - 1); |
853 | 852 | ||
854 | if (mthca_is_memfree(dev)) { | 853 | if (mthca_is_memfree(dev)) { |
@@ -1112,9 +1111,9 @@ static int mthca_alloc_qp_common(struct mthca_dev *dev, | |||
1112 | qp->atomic_rd_en = 0; | 1111 | qp->atomic_rd_en = 0; |
1113 | qp->resp_depth = 0; | 1112 | qp->resp_depth = 0; |
1114 | qp->sq_policy = send_policy; | 1113 | qp->sq_policy = send_policy; |
1115 | mthca_wq_init(&qp->sq); | 1114 | mthca_wq_reset(&qp->sq); |
1116 | mthca_wq_init(&qp->rq); | 1115 | mthca_wq_reset(&qp->rq); |
1117 | /* these are initialized separately so lockdep can tell them apart */ | 1116 | |
1118 | spin_lock_init(&qp->sq.lock); | 1117 | spin_lock_init(&qp->sq.lock); |
1119 | spin_lock_init(&qp->rq.lock); | 1118 | spin_lock_init(&qp->rq.lock); |
1120 | 1119 | ||