Merge branch 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/linvil...
[pandora-kernel.git] / drivers / infiniband / hw / mthca / mthca_cq.c
index 3e27a08..149b369 100644 (file)
@@ -39,6 +39,8 @@
 #include <linux/init.h>
 #include <linux/hardirq.h>
 
+#include <asm/io.h>
+
 #include <rdma/ib_pack.h>
 
 #include "mthca_dev.h"
@@ -210,6 +212,11 @@ static inline void update_cons_index(struct mthca_dev *dev, struct mthca_cq *cq,
                mthca_write64(doorbell,
                              dev->kar + MTHCA_CQ_DOORBELL,
                              MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock));
+               /*
+                * Make sure doorbells don't leak out of CQ spinlock
+                * and reach the HCA out of order:
+                */
+               mmiowb();
        }
 }
 
@@ -544,11 +551,11 @@ static inline int mthca_poll_one(struct mthca_dev *dev,
                wq = &(*cur_qp)->rq;
                wqe = be32_to_cpu(cqe->wqe);
                wqe_index = wqe >> wq->wqe_shift;
-               /*
-               * WQE addr == base - 1 might be reported in receive completion
-               * with error instead of (rq size - 1) by Sinai FW 1.0.800 and
-               * Arbel FW 5.1.400.  This bug should be fixed in later FW revs.
-               */
+               /*
+                * WQE addr == base - 1 might be reported in receive completion
+                * with error instead of (rq size - 1) by Sinai FW 1.0.800 and
+                * Arbel FW 5.1.400.  This bug should be fixed in later FW revs.
+                */
                if (unlikely(wqe_index < 0))
                        wqe_index = wq->max - 1;
                entry->wr_id = (*cur_qp)->wrid[wqe_index];