aboutsummaryrefslogtreecommitdiff
path: root/drivers/infiniband/hw/mthca/mthca_cq.c
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2006-06-17 20:37:41 -0700
committerRoland Dreier <rolandd@cisco.com>2006-06-17 20:37:41 -0700
commitc93b6fbaa99bb3a1552e14317296be14dde51dfb (patch)
treebad61dc728f0eb28fcfdf01953cd0ae43a4b2350 /drivers/infiniband/hw/mthca/mthca_cq.c
parentc9c5d9feef86debee4d8e77a738ad86877cf371a (diff)
IB/mthca: Make all device methods truly reentrant
Documentation/infiniband/core_locking.txt says: All of the methods in struct ib_device exported by a low-level driver must be fully reentrant. The low-level driver is required to perform all synchronization necessary to maintain consistency, even if multiple function calls using the same object are run simultaneously. However, mthca's modify_qp, modify_srq and resize_cq methods are currently not reentrant. Add a mutex to the QP, SRQ and CQ structures so that these calls can be properly serialized. Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_cq.c')
-rw-r--r--drivers/infiniband/hw/mthca/mthca_cq.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_cq.c b/drivers/infiniband/hw/mthca/mthca_cq.c
index 87a8f1166a3..3e27a084257 100644
--- a/drivers/infiniband/hw/mthca/mthca_cq.c
+++ b/drivers/infiniband/hw/mthca/mthca_cq.c
@@ -822,6 +822,7 @@ int mthca_init_cq(struct mthca_dev *dev, int nent,
spin_lock_init(&cq->lock);
cq->refcount = 1;
init_waitqueue_head(&cq->wait);
+ mutex_init(&cq->mutex);
memset(cq_context, 0, sizeof *cq_context);
cq_context->flags = cpu_to_be32(MTHCA_CQ_STATUS_OK |