]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/infiniband/hw/cxgb3/iwch_qp.c
Merge branch 'master' into tk71
[mv-sheeva.git] / drivers / infiniband / hw / cxgb3 / iwch_qp.c
index c64d27bf2c15b20eba43ddf91051ece1212495fb..1b4cd09f74dc2517567d8595fdd416c13ddd4941 100644 (file)
@@ -802,14 +802,12 @@ int iwch_post_terminate(struct iwch_qp *qhp, struct respQ_msg_t *rsp_msg)
 /*
  * Assumes qhp lock is held.
  */
-static void __flush_qp(struct iwch_qp *qhp, unsigned long *flag)
+static void __flush_qp(struct iwch_qp *qhp, struct iwch_cq *rchp,
+                               struct iwch_cq *schp, unsigned long *flag)
 {
-       struct iwch_cq *rchp, *schp;
        int count;
        int flushed;
 
-       rchp = get_chp(qhp->rhp, qhp->attr.rcq);
-       schp = get_chp(qhp->rhp, qhp->attr.scq);
 
        PDBG("%s qhp %p rchp %p schp %p\n", __func__, qhp, rchp, schp);
        /* take a ref on the qhp since we must release the lock */
@@ -847,10 +845,23 @@ static void __flush_qp(struct iwch_qp *qhp, unsigned long *flag)
 
 static void flush_qp(struct iwch_qp *qhp, unsigned long *flag)
 {
-       if (qhp->ibqp.uobject)
+       struct iwch_cq *rchp, *schp;
+
+       rchp = get_chp(qhp->rhp, qhp->attr.rcq);
+       schp = get_chp(qhp->rhp, qhp->attr.scq);
+
+       if (qhp->ibqp.uobject) {
                cxio_set_wq_in_error(&qhp->wq);
-       else
-               __flush_qp(qhp, flag);
+               cxio_set_cq_in_error(&rchp->cq);
+               (*rchp->ibcq.comp_handler)(&rchp->ibcq, rchp->ibcq.cq_context);
+               if (schp != rchp) {
+                       cxio_set_cq_in_error(&schp->cq);
+                       (*schp->ibcq.comp_handler)(&schp->ibcq,
+                                                  schp->ibcq.cq_context);
+               }
+               return;
+       }
+       __flush_qp(qhp, rchp, schp, flag);
 }
 
 
@@ -1138,59 +1149,3 @@ out:
        PDBG("%s exit state %d\n", __func__, qhp->attr.state);
        return ret;
 }
-
-static int quiesce_qp(struct iwch_qp *qhp)
-{
-       spin_lock_irq(&qhp->lock);
-       iwch_quiesce_tid(qhp->ep);
-       qhp->flags |= QP_QUIESCED;
-       spin_unlock_irq(&qhp->lock);
-       return 0;
-}
-
-static int resume_qp(struct iwch_qp *qhp)
-{
-       spin_lock_irq(&qhp->lock);
-       iwch_resume_tid(qhp->ep);
-       qhp->flags &= ~QP_QUIESCED;
-       spin_unlock_irq(&qhp->lock);
-       return 0;
-}
-
-int iwch_quiesce_qps(struct iwch_cq *chp)
-{
-       int i;
-       struct iwch_qp *qhp;
-
-       for (i=0; i < T3_MAX_NUM_QP; i++) {
-               qhp = get_qhp(chp->rhp, i);
-               if (!qhp)
-                       continue;
-               if ((qhp->attr.rcq == chp->cq.cqid) && !qp_quiesced(qhp)) {
-                       quiesce_qp(qhp);
-                       continue;
-               }
-               if ((qhp->attr.scq == chp->cq.cqid) && !qp_quiesced(qhp))
-                       quiesce_qp(qhp);
-       }
-       return 0;
-}
-
-int iwch_resume_qps(struct iwch_cq *chp)
-{
-       int i;
-       struct iwch_qp *qhp;
-
-       for (i=0; i < T3_MAX_NUM_QP; i++) {
-               qhp = get_qhp(chp->rhp, i);
-               if (!qhp)
-                       continue;
-               if ((qhp->attr.rcq == chp->cq.cqid) && qp_quiesced(qhp)) {
-                       resume_qp(qhp);
-                       continue;
-               }
-               if ((qhp->attr.scq == chp->cq.cqid) && qp_quiesced(qhp))
-                       resume_qp(qhp);
-       }
-       return 0;
-}