From 5b366a7305ebeece25cef3322bb49f2ae524f619 Mon Sep 17 00:00:00 2001 From: Ralph Campbell Date: Fri, 19 Oct 2007 15:04:10 -0700 Subject: [PATCH] --- yaml --- r: 72919 b: refs/heads/master c: fffbfeaa680e2b87a591e141f2aa7e9e91184956 h: refs/heads/master i: 72917: 2c143dd0043e0ceb5996c948a0561653b07dd624 72915: 4c335a9e1a9bc0c88454e3b12e816b7e708b9bc6 72911: 4197d555c1db67363a03fb7138094b3a9d56a703 v: v3 --- [refs] | 2 +- trunk/drivers/infiniband/hw/ipath/ipath_ruc.c | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 4b78cc24cd31..df7266e8dc49 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 96db0e0335c7981911bd7efc5c79e82d2358c0fc +refs/heads/master: fffbfeaa680e2b87a591e141f2aa7e9e91184956 diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_ruc.c b/trunk/drivers/infiniband/hw/ipath/ipath_ruc.c index 4b6b7ee8e5c1..54c61a972de2 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_ruc.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_ruc.c @@ -630,11 +630,8 @@ bail:; void ipath_send_complete(struct ipath_qp *qp, struct ipath_swqe *wqe, enum ib_wc_status status) { - u32 last = qp->s_last; - - if (++last == qp->s_size) - last = 0; - qp->s_last = last; + unsigned long flags; + u32 last; /* See ch. 11.2.4.1 and 10.7.3.1 */ if (!(qp->s_flags & IPATH_S_SIGNAL_REQ_WR) || @@ -658,4 +655,11 @@ void ipath_send_complete(struct ipath_qp *qp, struct ipath_swqe *wqe, wc.port_num = 0; ipath_cq_enter(to_icq(qp->ibqp.send_cq), &wc, 0); } + + spin_lock_irqsave(&qp->s_lock, flags); + last = qp->s_last; + if (++last >= qp->s_size) + last = 0; + qp->s_last = last; + spin_unlock_irqrestore(&qp->s_lock, flags); }