aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ipath/ipath_ruc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_ruc.c')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_ruc.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_ruc.c b/drivers/infiniband/hw/ipath/ipath_ruc.c
index 4b6b7ee8e5c1..54c61a972de2 100644
--- a/drivers/infiniband/hw/ipath/ipath_ruc.c
+++ b/drivers/infiniband/hw/ipath/ipath_ruc.c
@@ -630,11 +630,8 @@ bail:;
630void ipath_send_complete(struct ipath_qp *qp, struct ipath_swqe *wqe, 630void ipath_send_complete(struct ipath_qp *qp, struct ipath_swqe *wqe,
631 enum ib_wc_status status) 631 enum ib_wc_status status)
632{ 632{
633 u32 last = qp->s_last; 633 unsigned long flags;
634 634 u32 last;
635 if (++last == qp->s_size)
636 last = 0;
637 qp->s_last = last;
638 635
639 /* See ch. 11.2.4.1 and 10.7.3.1 */ 636 /* See ch. 11.2.4.1 and 10.7.3.1 */
640 if (!(qp->s_flags & IPATH_S_SIGNAL_REQ_WR) || 637 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,
658 wc.port_num = 0; 655 wc.port_num = 0;
659 ipath_cq_enter(to_icq(qp->ibqp.send_cq), &wc, 0); 656 ipath_cq_enter(to_icq(qp->ibqp.send_cq), &wc, 0);
660 } 657 }
658
659 spin_lock_irqsave(&qp->s_lock, flags);
660 last = qp->s_last;
661 if (++last >= qp->s_size)
662 last = 0;
663 qp->s_last = last;
664 spin_unlock_irqrestore(&qp->s_lock, flags);
661} 665}