IB/qib: Clear WAIT_SEND flags when setting QP to error state
[platform/adaptation/renesas_rcar/renesas_kernel.git] / drivers / infiniband / hw / qib / qib_qp.c
index e0f65e3..32dacd4 100644 (file)
@@ -450,7 +450,7 @@ static void clear_mr_refs(struct qib_qp *qp, int clr_sends)
  *
  * Flushes both send and receive work queues.
  * Returns true if last WQE event should be generated.
- * The QP s_lock should be held and interrupts disabled.
+ * The QP r_lock and s_lock should be held and interrupts disabled.
  * If we are already in error state, just return.
  */
 int qib_error_qp(struct qib_qp *qp, enum ib_wc_status err)
@@ -468,6 +468,10 @@ int qib_error_qp(struct qib_qp *qp, enum ib_wc_status err)
                qp->s_flags &= ~(QIB_S_TIMER | QIB_S_WAIT_RNR);
                del_timer(&qp->s_timer);
        }
+
+       if (qp->s_flags & QIB_S_ANY_WAIT_SEND)
+               qp->s_flags &= ~QIB_S_ANY_WAIT_SEND;
+
        spin_lock(&dev->pending_lock);
        if (!list_empty(&qp->iowait) && !(qp->s_flags & QIB_S_BUSY)) {
                qp->s_flags &= ~QIB_S_ANY_WAIT_IO;