diff options
-rw-r--r-- | drivers/infiniband/hw/qedr/verbs.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/drivers/infiniband/hw/qedr/verbs.c b/drivers/infiniband/hw/qedr/verbs.c index 1835dc9eb3e3..26a698927d2e 100644 --- a/drivers/infiniband/hw/qedr/verbs.c +++ b/drivers/infiniband/hw/qedr/verbs.c | |||
@@ -804,8 +804,6 @@ static inline void qedr_init_cq_params(struct qedr_cq *cq, | |||
804 | 804 | ||
805 | static void doorbell_cq(struct qedr_cq *cq, u32 cons, u8 flags) | 805 | static void doorbell_cq(struct qedr_cq *cq, u32 cons, u8 flags) |
806 | { | 806 | { |
807 | /* Flush data before signalling doorbell */ | ||
808 | wmb(); | ||
809 | cq->db.data.agg_flags = flags; | 807 | cq->db.data.agg_flags = flags; |
810 | cq->db.data.value = cpu_to_le32(cons); | 808 | cq->db.data.value = cpu_to_le32(cons); |
811 | writeq(cq->db.raw, cq->db_addr); | 809 | writeq(cq->db.raw, cq->db_addr); |
@@ -1812,8 +1810,7 @@ static int qedr_update_qp_state(struct qedr_dev *dev, | |||
1812 | */ | 1810 | */ |
1813 | 1811 | ||
1814 | if (rdma_protocol_roce(&dev->ibdev, 1)) { | 1812 | if (rdma_protocol_roce(&dev->ibdev, 1)) { |
1815 | wmb(); | 1813 | writel(qp->rq.db_data.raw, qp->rq.db); |
1816 | writel_relaxed(qp->rq.db_data.raw, qp->rq.db); | ||
1817 | /* Make sure write takes effect */ | 1814 | /* Make sure write takes effect */ |
1818 | mmiowb(); | 1815 | mmiowb(); |
1819 | } | 1816 | } |
@@ -3198,9 +3195,16 @@ int qedr_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, | |||
3198 | * vane. However this is not harmful (as long as the producer value is | 3195 | * vane. However this is not harmful (as long as the producer value is |
3199 | * unchanged). For performance reasons we avoid checking for this | 3196 | * unchanged). For performance reasons we avoid checking for this |
3200 | * redundant doorbell. | 3197 | * redundant doorbell. |
3198 | * | ||
3199 | * qp->wqe_wr_id is accessed during qedr_poll_cq, as | ||
3200 | * soon as we give the doorbell, we could get a completion | ||
3201 | * for this wr, therefore we need to make sure that the | ||
3202 | * memory is updated before giving the doorbell. | ||
3203 | * During qedr_poll_cq, rmb is called before accessing the | ||
3204 | * cqe. This covers for the smp_rmb as well. | ||
3201 | */ | 3205 | */ |
3202 | wmb(); | 3206 | smp_wmb(); |
3203 | writel_relaxed(qp->sq.db_data.raw, qp->sq.db); | 3207 | writel(qp->sq.db_data.raw, qp->sq.db); |
3204 | 3208 | ||
3205 | /* Make sure write sticks */ | 3209 | /* Make sure write sticks */ |
3206 | mmiowb(); | 3210 | mmiowb(); |
@@ -3286,8 +3290,14 @@ int qedr_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr, | |||
3286 | 3290 | ||
3287 | qedr_inc_sw_prod(&qp->rq); | 3291 | qedr_inc_sw_prod(&qp->rq); |
3288 | 3292 | ||
3289 | /* Flush all the writes before signalling doorbell */ | 3293 | /* qp->rqe_wr_id is accessed during qedr_poll_cq, as |
3290 | wmb(); | 3294 | * soon as we give the doorbell, we could get a completion |
3295 | * for this wr, therefore we need to make sure that the | ||
3296 | * memory is update before giving the doorbell. | ||
3297 | * During qedr_poll_cq, rmb is called before accessing the | ||
3298 | * cqe. This covers for the smp_rmb as well. | ||
3299 | */ | ||
3300 | smp_wmb(); | ||
3291 | 3301 | ||
3292 | qp->rq.db_data.data.value++; | 3302 | qp->rq.db_data.data.value++; |
3293 | 3303 | ||