]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/infiniband/hw/ipath/ipath_verbs.c
Merge branches 'cma', 'cxgb3', 'ehca', 'ipath', 'ipoib', 'mad', 'misc', 'mlx4', ...
[linux-2.6-omap-h63xx.git] / drivers / infiniband / hw / ipath / ipath_verbs.c
index 55c71882882638508bef3272b97554cc7de334b6..eabc4247860b429db0d6603bba4e16c943d0af7c 100644 (file)
@@ -340,9 +340,16 @@ static int ipath_post_one_send(struct ipath_qp *qp, struct ib_send_wr *wr)
        int acc;
        int ret;
        unsigned long flags;
+       struct ipath_devdata *dd = to_idev(qp->ibqp.device)->dd;
 
        spin_lock_irqsave(&qp->s_lock, flags);
 
+       if (qp->ibqp.qp_type != IB_QPT_SMI &&
+           !(dd->ipath_flags & IPATH_LINKACTIVE)) {
+               ret = -ENETDOWN;
+               goto bail;
+       }
+
        /* Check that state is OK to post send. */
        if (unlikely(!(ib_ipath_state_ops[qp->state] & IPATH_POST_SEND_OK)))
                goto bail_inval;
@@ -1021,7 +1028,7 @@ static void sdma_complete(void *cookie, int status)
        struct ipath_verbs_txreq *tx = cookie;
        struct ipath_qp *qp = tx->qp;
        struct ipath_ibdev *dev = to_idev(qp->ibqp.device);
-       unsigned int flags;
+       unsigned long flags;
        enum ib_wc_status ibs = status == IPATH_SDMA_TXREQ_S_OK ?
                IB_WC_SUCCESS : IB_WC_WR_FLUSH_ERR;
 
@@ -1051,7 +1058,7 @@ static void sdma_complete(void *cookie, int status)
 
 static void decrement_dma_busy(struct ipath_qp *qp)
 {
-       unsigned int flags;
+       unsigned long flags;
 
        if (atomic_dec_and_test(&qp->s_dma_busy)) {
                spin_lock_irqsave(&qp->s_lock, flags);
@@ -1221,7 +1228,7 @@ static int ipath_verbs_send_pio(struct ipath_qp *qp,
        unsigned flush_wc;
        u32 control;
        int ret;
-       unsigned int flags;
+       unsigned long flags;
 
        piobuf = ipath_getpiobuf(dd, plen, NULL);
        if (unlikely(piobuf == NULL)) {