diff options
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_srq.c')
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_srq.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_srq.c b/drivers/infiniband/hw/mthca/mthca_srq.c index b292fefa3b4..fab417c5cf4 100644 --- a/drivers/infiniband/hw/mthca/mthca_srq.c +++ b/drivers/infiniband/hw/mthca/mthca_srq.c | |||
@@ -243,6 +243,7 @@ int mthca_alloc_srq(struct mthca_dev *dev, struct mthca_pd *pd, | |||
243 | spin_lock_init(&srq->lock); | 243 | spin_lock_init(&srq->lock); |
244 | srq->refcount = 1; | 244 | srq->refcount = 1; |
245 | init_waitqueue_head(&srq->wait); | 245 | init_waitqueue_head(&srq->wait); |
246 | mutex_init(&srq->mutex); | ||
246 | 247 | ||
247 | if (mthca_is_memfree(dev)) | 248 | if (mthca_is_memfree(dev)) |
248 | mthca_arbel_init_srq_context(dev, pd, srq, mailbox->buf); | 249 | mthca_arbel_init_srq_context(dev, pd, srq, mailbox->buf); |
@@ -371,7 +372,11 @@ int mthca_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr, | |||
371 | if (attr_mask & IB_SRQ_LIMIT) { | 372 | if (attr_mask & IB_SRQ_LIMIT) { |
372 | if (attr->srq_limit > srq->max) | 373 | if (attr->srq_limit > srq->max) |
373 | return -EINVAL; | 374 | return -EINVAL; |
375 | |||
376 | mutex_lock(&srq->mutex); | ||
374 | ret = mthca_ARM_SRQ(dev, srq->srqn, attr->srq_limit, &status); | 377 | ret = mthca_ARM_SRQ(dev, srq->srqn, attr->srq_limit, &status); |
378 | mutex_unlock(&srq->mutex); | ||
379 | |||
375 | if (ret) | 380 | if (ret) |
376 | return ret; | 381 | return ret; |
377 | if (status) | 382 | if (status) |