diff options
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_rc.c')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_rc.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_rc.c b/drivers/infiniband/hw/ipath/ipath_rc.c index a4055ca00614..493b1821a934 100644 --- a/drivers/infiniband/hw/ipath/ipath_rc.c +++ b/drivers/infiniband/hw/ipath/ipath_rc.c | |||
@@ -57,7 +57,7 @@ static void ipath_init_restart(struct ipath_qp *qp, struct ipath_swqe *wqe) | |||
57 | qp->s_len = wqe->length - len; | 57 | qp->s_len = wqe->length - len; |
58 | dev = to_idev(qp->ibqp.device); | 58 | dev = to_idev(qp->ibqp.device); |
59 | spin_lock(&dev->pending_lock); | 59 | spin_lock(&dev->pending_lock); |
60 | if (qp->timerwait.next == LIST_POISON1) | 60 | if (list_empty(&qp->timerwait)) |
61 | list_add_tail(&qp->timerwait, | 61 | list_add_tail(&qp->timerwait, |
62 | &dev->pending[dev->pending_index]); | 62 | &dev->pending[dev->pending_index]); |
63 | spin_unlock(&dev->pending_lock); | 63 | spin_unlock(&dev->pending_lock); |
@@ -356,7 +356,7 @@ static inline int ipath_make_rc_req(struct ipath_qp *qp, | |||
356 | if ((int)(qp->s_psn - qp->s_next_psn) > 0) | 356 | if ((int)(qp->s_psn - qp->s_next_psn) > 0) |
357 | qp->s_next_psn = qp->s_psn; | 357 | qp->s_next_psn = qp->s_psn; |
358 | spin_lock(&dev->pending_lock); | 358 | spin_lock(&dev->pending_lock); |
359 | if (qp->timerwait.next == LIST_POISON1) | 359 | if (list_empty(&qp->timerwait)) |
360 | list_add_tail(&qp->timerwait, | 360 | list_add_tail(&qp->timerwait, |
361 | &dev->pending[dev->pending_index]); | 361 | &dev->pending[dev->pending_index]); |
362 | spin_unlock(&dev->pending_lock); | 362 | spin_unlock(&dev->pending_lock); |
@@ -726,8 +726,8 @@ void ipath_restart_rc(struct ipath_qp *qp, u32 psn, struct ib_wc *wc) | |||
726 | */ | 726 | */ |
727 | dev = to_idev(qp->ibqp.device); | 727 | dev = to_idev(qp->ibqp.device); |
728 | spin_lock(&dev->pending_lock); | 728 | spin_lock(&dev->pending_lock); |
729 | if (qp->timerwait.next != LIST_POISON1) | 729 | if (!list_empty(&qp->timerwait)) |
730 | list_del(&qp->timerwait); | 730 | list_del_init(&qp->timerwait); |
731 | spin_unlock(&dev->pending_lock); | 731 | spin_unlock(&dev->pending_lock); |
732 | 732 | ||
733 | if (wqe->wr.opcode == IB_WR_RDMA_READ) | 733 | if (wqe->wr.opcode == IB_WR_RDMA_READ) |
@@ -886,8 +886,8 @@ static int do_rc_ack(struct ipath_qp *qp, u32 aeth, u32 psn, int opcode) | |||
886 | * just won't find anything to restart if we ACK everything. | 886 | * just won't find anything to restart if we ACK everything. |
887 | */ | 887 | */ |
888 | spin_lock(&dev->pending_lock); | 888 | spin_lock(&dev->pending_lock); |
889 | if (qp->timerwait.next != LIST_POISON1) | 889 | if (!list_empty(&qp->timerwait)) |
890 | list_del(&qp->timerwait); | 890 | list_del_init(&qp->timerwait); |
891 | spin_unlock(&dev->pending_lock); | 891 | spin_unlock(&dev->pending_lock); |
892 | 892 | ||
893 | /* | 893 | /* |
@@ -1194,8 +1194,7 @@ static inline void ipath_rc_rcv_resp(struct ipath_ibdev *dev, | |||
1194 | IB_WR_RDMA_READ)) | 1194 | IB_WR_RDMA_READ)) |
1195 | goto ack_done; | 1195 | goto ack_done; |
1196 | spin_lock(&dev->pending_lock); | 1196 | spin_lock(&dev->pending_lock); |
1197 | if (qp->s_rnr_timeout == 0 && | 1197 | if (qp->s_rnr_timeout == 0 && !list_empty(&qp->timerwait)) |
1198 | qp->timerwait.next != LIST_POISON1) | ||
1199 | list_move_tail(&qp->timerwait, | 1198 | list_move_tail(&qp->timerwait, |
1200 | &dev->pending[dev->pending_index]); | 1199 | &dev->pending[dev->pending_index]); |
1201 | spin_unlock(&dev->pending_lock); | 1200 | spin_unlock(&dev->pending_lock); |