]> git.karo-electronics.de Git - linux-beck.git/commitdiff
IB/hfi1: Replace qp->refcount release code with standard driver wrapper
authorSebastian Sanchez <sebastian.sanchez@intel.com>
Thu, 8 Dec 2016 03:33:46 +0000 (19:33 -0800)
committerDoug Ledford <dledford@redhat.com>
Sun, 11 Dec 2016 20:29:42 +0000 (15:29 -0500)
Some parts of the code don't use the standard release
wrapper rvt_put_qp() for decrementing and testing
the refcount to then try to use a resource.
Replace this code with the standard driver wrapper.

Fixes: Commit 4d6f85c3fa55 ("IB/rdmavt, IB/qib, IB/hfi1: Use new QP put get routines")
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Sebastian Sanchez <sebastian.sanchez@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hfi1/driver.c
drivers/infiniband/sw/rdmavt/mcast.c

index 6563e4d38b80c141df9d9fd766d5eac9779eb914..d4261163bd25549599750d28a9c6e08279462d25 100644 (file)
@@ -793,8 +793,7 @@ static inline void process_rcv_qp_work(struct hfi1_packet *packet)
                                hfi1_schedule_send(qp);
                        spin_unlock_irqrestore(&qp->s_lock, flags);
                }
-               if (atomic_dec_and_test(&qp->refcount))
-                       wake_up(&qp->wait);
+               rvt_put_qp(qp);
        }
 }
 
index 983d319ac976e1ff1217564ccd9fd944894d10dc..05c8c2afb0e33a70fca3014e3bdf3a77bfe5b1a6 100644 (file)
@@ -81,7 +81,7 @@ static struct rvt_mcast_qp *rvt_mcast_qp_alloc(struct rvt_qp *qp)
                goto bail;
 
        mqp->qp = qp;
-       atomic_inc(&qp->refcount);
+       rvt_get_qp(qp);
 
 bail:
        return mqp;
@@ -92,8 +92,7 @@ static void rvt_mcast_qp_free(struct rvt_mcast_qp *mqp)
        struct rvt_qp *qp = mqp->qp;
 
        /* Notify hfi1_destroy_qp() if it is waiting. */
-       if (atomic_dec_and_test(&qp->refcount))
-               wake_up(&qp->wait);
+       rvt_put_qp(qp);
 
        kfree(mqp);
 }