]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
IB/ipath: fix spinlock recursion bug
authorBryan O'Sullivan <bos@pathscale.com>
Tue, 23 May 2006 18:32:29 +0000 (11:32 -0700)
committerRoland Dreier <rolandd@cisco.com>
Tue, 23 May 2006 20:27:06 +0000 (13:27 -0700)
The local loopback path for RC can lock the rkey table lock without
blocking interrupts.  The receive interrupt path can then call
ipath_rkey_ok() and deadlock.  Remove the redundant lock.

Signed-off-by: Bryan O'Sullivan <bos@pathscale.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/ipath/ipath_keys.c

index aa33b0e9f2f6330aeba82f2ad85d4621b940aecd..5ae8761f9dd2e8b3ed5dc86430ac9617c251aab9 100644 (file)
@@ -136,9 +136,7 @@ int ipath_lkey_ok(struct ipath_lkey_table *rkt, struct ipath_sge *isge,
                ret = 1;
                goto bail;
        }
-       spin_lock(&rkt->lock);
        mr = rkt->table[(sge->lkey >> (32 - ib_ipath_lkey_table_size))];
-       spin_unlock(&rkt->lock);
        if (unlikely(mr == NULL || mr->lkey != sge->lkey)) {
                ret = 0;
                goto bail;
@@ -184,8 +182,6 @@ bail:
  * @acc: access flags
  *
  * Return 1 if successful, otherwise 0.
- *
- * The QP r_rq.lock should be held.
  */
 int ipath_rkey_ok(struct ipath_ibdev *dev, struct ipath_sge_state *ss,
                  u32 len, u64 vaddr, u32 rkey, int acc)
@@ -196,9 +192,7 @@ int ipath_rkey_ok(struct ipath_ibdev *dev, struct ipath_sge_state *ss,
        size_t off;
        int ret;
 
-       spin_lock(&rkt->lock);
        mr = rkt->table[(rkey >> (32 - ib_ipath_lkey_table_size))];
-       spin_unlock(&rkt->lock);
        if (unlikely(mr == NULL || mr->lkey != rkey)) {
                ret = 0;
                goto bail;