diff options
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_cq.c | 7 | ||||
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_qp.c | 19 | ||||
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_srq.c | 8 |
3 files changed, 34 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_cq.c b/drivers/infiniband/hw/mthca/mthca_cq.c index e393681ba7d4..149b36901239 100644 --- a/drivers/infiniband/hw/mthca/mthca_cq.c +++ b/drivers/infiniband/hw/mthca/mthca_cq.c | |||
@@ -39,6 +39,8 @@ | |||
39 | #include <linux/init.h> | 39 | #include <linux/init.h> |
40 | #include <linux/hardirq.h> | 40 | #include <linux/hardirq.h> |
41 | 41 | ||
42 | #include <asm/io.h> | ||
43 | |||
42 | #include <rdma/ib_pack.h> | 44 | #include <rdma/ib_pack.h> |
43 | 45 | ||
44 | #include "mthca_dev.h" | 46 | #include "mthca_dev.h" |
@@ -210,6 +212,11 @@ static inline void update_cons_index(struct mthca_dev *dev, struct mthca_cq *cq, | |||
210 | mthca_write64(doorbell, | 212 | mthca_write64(doorbell, |
211 | dev->kar + MTHCA_CQ_DOORBELL, | 213 | dev->kar + MTHCA_CQ_DOORBELL, |
212 | MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock)); | 214 | MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock)); |
215 | /* | ||
216 | * Make sure doorbells don't leak out of CQ spinlock | ||
217 | * and reach the HCA out of order: | ||
218 | */ | ||
219 | mmiowb(); | ||
213 | } | 220 | } |
214 | } | 221 | } |
215 | 222 | ||
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c index 5e5c58b9920b..6a7822e0fc19 100644 --- a/drivers/infiniband/hw/mthca/mthca_qp.c +++ b/drivers/infiniband/hw/mthca/mthca_qp.c | |||
@@ -39,6 +39,8 @@ | |||
39 | #include <linux/string.h> | 39 | #include <linux/string.h> |
40 | #include <linux/slab.h> | 40 | #include <linux/slab.h> |
41 | 41 | ||
42 | #include <asm/io.h> | ||
43 | |||
42 | #include <rdma/ib_verbs.h> | 44 | #include <rdma/ib_verbs.h> |
43 | #include <rdma/ib_cache.h> | 45 | #include <rdma/ib_cache.h> |
44 | #include <rdma/ib_pack.h> | 46 | #include <rdma/ib_pack.h> |
@@ -1732,6 +1734,11 @@ out: | |||
1732 | mthca_write64(doorbell, | 1734 | mthca_write64(doorbell, |
1733 | dev->kar + MTHCA_SEND_DOORBELL, | 1735 | dev->kar + MTHCA_SEND_DOORBELL, |
1734 | MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock)); | 1736 | MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock)); |
1737 | /* | ||
1738 | * Make sure doorbells don't leak out of SQ spinlock | ||
1739 | * and reach the HCA out of order: | ||
1740 | */ | ||
1741 | mmiowb(); | ||
1735 | } | 1742 | } |
1736 | 1743 | ||
1737 | qp->sq.next_ind = ind; | 1744 | qp->sq.next_ind = ind; |
@@ -1851,6 +1858,12 @@ out: | |||
1851 | qp->rq.next_ind = ind; | 1858 | qp->rq.next_ind = ind; |
1852 | qp->rq.head += nreq; | 1859 | qp->rq.head += nreq; |
1853 | 1860 | ||
1861 | /* | ||
1862 | * Make sure doorbells don't leak out of RQ spinlock and reach | ||
1863 | * the HCA out of order: | ||
1864 | */ | ||
1865 | mmiowb(); | ||
1866 | |||
1854 | spin_unlock_irqrestore(&qp->rq.lock, flags); | 1867 | spin_unlock_irqrestore(&qp->rq.lock, flags); |
1855 | return err; | 1868 | return err; |
1856 | } | 1869 | } |
@@ -2112,6 +2125,12 @@ out: | |||
2112 | MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock)); | 2125 | MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock)); |
2113 | } | 2126 | } |
2114 | 2127 | ||
2128 | /* | ||
2129 | * Make sure doorbells don't leak out of SQ spinlock and reach | ||
2130 | * the HCA out of order: | ||
2131 | */ | ||
2132 | mmiowb(); | ||
2133 | |||
2115 | spin_unlock_irqrestore(&qp->sq.lock, flags); | 2134 | spin_unlock_irqrestore(&qp->sq.lock, flags); |
2116 | return err; | 2135 | return err; |
2117 | } | 2136 | } |
diff --git a/drivers/infiniband/hw/mthca/mthca_srq.c b/drivers/infiniband/hw/mthca/mthca_srq.c index 92a72f521528..f5d7677d1079 100644 --- a/drivers/infiniband/hw/mthca/mthca_srq.c +++ b/drivers/infiniband/hw/mthca/mthca_srq.c | |||
@@ -35,6 +35,8 @@ | |||
35 | #include <linux/slab.h> | 35 | #include <linux/slab.h> |
36 | #include <linux/string.h> | 36 | #include <linux/string.h> |
37 | 37 | ||
38 | #include <asm/io.h> | ||
39 | |||
38 | #include "mthca_dev.h" | 40 | #include "mthca_dev.h" |
39 | #include "mthca_cmd.h" | 41 | #include "mthca_cmd.h" |
40 | #include "mthca_memfree.h" | 42 | #include "mthca_memfree.h" |
@@ -595,6 +597,12 @@ int mthca_tavor_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr, | |||
595 | MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock)); | 597 | MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock)); |
596 | } | 598 | } |
597 | 599 | ||
600 | /* | ||
601 | * Make sure doorbells don't leak out of SRQ spinlock and | ||
602 | * reach the HCA out of order: | ||
603 | */ | ||
604 | mmiowb(); | ||
605 | |||
598 | spin_unlock_irqrestore(&srq->lock, flags); | 606 | spin_unlock_irqrestore(&srq->lock, flags); |
599 | return err; | 607 | return err; |
600 | } | 608 | } |