diff options
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_ruc.c')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_ruc.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_ruc.c b/drivers/infiniband/hw/ipath/ipath_ruc.c index 54c61a972de2..a59bdbd0ed87 100644 --- a/drivers/infiniband/hw/ipath/ipath_ruc.c +++ b/drivers/infiniband/hw/ipath/ipath_ruc.c | |||
@@ -98,11 +98,15 @@ void ipath_insert_rnr_queue(struct ipath_qp *qp) | |||
98 | while (qp->s_rnr_timeout >= nqp->s_rnr_timeout) { | 98 | while (qp->s_rnr_timeout >= nqp->s_rnr_timeout) { |
99 | qp->s_rnr_timeout -= nqp->s_rnr_timeout; | 99 | qp->s_rnr_timeout -= nqp->s_rnr_timeout; |
100 | l = l->next; | 100 | l = l->next; |
101 | if (l->next == &dev->rnrwait) | 101 | if (l->next == &dev->rnrwait) { |
102 | nqp = NULL; | ||
102 | break; | 103 | break; |
104 | } | ||
103 | nqp = list_entry(l->next, struct ipath_qp, | 105 | nqp = list_entry(l->next, struct ipath_qp, |
104 | timerwait); | 106 | timerwait); |
105 | } | 107 | } |
108 | if (nqp) | ||
109 | nqp->s_rnr_timeout -= qp->s_rnr_timeout; | ||
106 | list_add(&qp->timerwait, l); | 110 | list_add(&qp->timerwait, l); |
107 | } | 111 | } |
108 | spin_unlock_irqrestore(&dev->pending_lock, flags); | 112 | spin_unlock_irqrestore(&dev->pending_lock, flags); |
@@ -479,9 +483,14 @@ done: | |||
479 | 483 | ||
480 | static void want_buffer(struct ipath_devdata *dd) | 484 | static void want_buffer(struct ipath_devdata *dd) |
481 | { | 485 | { |
482 | set_bit(IPATH_S_PIOINTBUFAVAIL, &dd->ipath_sendctrl); | 486 | unsigned long flags; |
487 | |||
488 | spin_lock_irqsave(&dd->ipath_sendctrl_lock, flags); | ||
489 | dd->ipath_sendctrl |= INFINIPATH_S_PIOINTBUFAVAIL; | ||
483 | ipath_write_kreg(dd, dd->ipath_kregs->kr_sendctrl, | 490 | ipath_write_kreg(dd, dd->ipath_kregs->kr_sendctrl, |
484 | dd->ipath_sendctrl); | 491 | dd->ipath_sendctrl); |
492 | ipath_read_kreg64(dd, dd->ipath_kregs->kr_scratch); | ||
493 | spin_unlock_irqrestore(&dd->ipath_sendctrl_lock, flags); | ||
485 | } | 494 | } |
486 | 495 | ||
487 | /** | 496 | /** |