aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ipath/ipath_qp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_qp.c')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_qp.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_qp.c b/drivers/infiniband/hw/ipath/ipath_qp.c
index b26146c16588..0924a21fec13 100644
--- a/drivers/infiniband/hw/ipath/ipath_qp.c
+++ b/drivers/infiniband/hw/ipath/ipath_qp.c
@@ -375,10 +375,10 @@ static void ipath_error_qp(struct ipath_qp *qp)
375 375
376 spin_lock(&dev->pending_lock); 376 spin_lock(&dev->pending_lock);
377 /* XXX What if its already removed by the timeout code? */ 377 /* XXX What if its already removed by the timeout code? */
378 if (qp->timerwait.next != LIST_POISON1) 378 if (!list_empty(&qp->timerwait))
379 list_del(&qp->timerwait); 379 list_del_init(&qp->timerwait);
380 if (qp->piowait.next != LIST_POISON1) 380 if (!list_empty(&qp->piowait))
381 list_del(&qp->piowait); 381 list_del_init(&qp->piowait);
382 spin_unlock(&dev->pending_lock); 382 spin_unlock(&dev->pending_lock);
383 383
384 wc.status = IB_WC_WR_FLUSH_ERR; 384 wc.status = IB_WC_WR_FLUSH_ERR;
@@ -712,10 +712,8 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
712 init_attr->qp_type == IB_QPT_RC ? 712 init_attr->qp_type == IB_QPT_RC ?
713 ipath_do_rc_send : ipath_do_uc_send, 713 ipath_do_rc_send : ipath_do_uc_send,
714 (unsigned long)qp); 714 (unsigned long)qp);
715 qp->piowait.next = LIST_POISON1; 715 INIT_LIST_HEAD(&qp->piowait);
716 qp->piowait.prev = LIST_POISON2; 716 INIT_LIST_HEAD(&qp->timerwait);
717 qp->timerwait.next = LIST_POISON1;
718 qp->timerwait.prev = LIST_POISON2;
719 qp->state = IB_QPS_RESET; 717 qp->state = IB_QPS_RESET;
720 qp->s_wq = swq; 718 qp->s_wq = swq;
721 qp->s_size = init_attr->cap.max_send_wr + 1; 719 qp->s_size = init_attr->cap.max_send_wr + 1;
@@ -785,10 +783,10 @@ int ipath_destroy_qp(struct ib_qp *ibqp)
785 783
786 /* Make sure the QP isn't on the timeout list. */ 784 /* Make sure the QP isn't on the timeout list. */
787 spin_lock_irqsave(&dev->pending_lock, flags); 785 spin_lock_irqsave(&dev->pending_lock, flags);
788 if (qp->timerwait.next != LIST_POISON1) 786 if (!list_empty(&qp->timerwait))
789 list_del(&qp->timerwait); 787 list_del_init(&qp->timerwait);
790 if (qp->piowait.next != LIST_POISON1) 788 if (!list_empty(&qp->piowait))
791 list_del(&qp->piowait); 789 list_del_init(&qp->piowait);
792 spin_unlock_irqrestore(&dev->pending_lock, flags); 790 spin_unlock_irqrestore(&dev->pending_lock, flags);
793 791
794 /* 792 /*
@@ -857,10 +855,10 @@ void ipath_sqerror_qp(struct ipath_qp *qp, struct ib_wc *wc)
857 855
858 spin_lock(&dev->pending_lock); 856 spin_lock(&dev->pending_lock);
859 /* XXX What if its already removed by the timeout code? */ 857 /* XXX What if its already removed by the timeout code? */
860 if (qp->timerwait.next != LIST_POISON1) 858 if (!list_empty(&qp->timerwait))
861 list_del(&qp->timerwait); 859 list_del_init(&qp->timerwait);
862 if (qp->piowait.next != LIST_POISON1) 860 if (!list_empty(&qp->piowait))
863 list_del(&qp->piowait); 861 list_del_init(&qp->piowait);
864 spin_unlock(&dev->pending_lock); 862 spin_unlock(&dev->pending_lock);
865 863
866 ipath_cq_enter(to_icq(qp->ibqp.send_cq), wc, 1); 864 ipath_cq_enter(to_icq(qp->ibqp.send_cq), wc, 1);