RDMA/qedr: eliminate duplicate barriers on weakly-ordered archs
authorSinan Kaya <okaya@codeaurora.org>
Wed, 14 Mar 2018 03:20:24 +0000 (23:20 -0400)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 15 Mar 2018 21:35:44 +0000 (15:35 -0600)
Code includes wmb() followed by writel() in multiple places. writel()
already has a barrier on some architectures like arm64.

This ends up CPU observing two barriers back to back before executing the
register write.

Since code already has an explicit barrier call, changing writel() to
writel_relaxed().

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/qedr/verbs.c

index 875b17272d65289d2cfa826f3635683831e19886..b61a395f89deb67ddb00417eb497f6c728574446 100644 (file)
@@ -1870,7 +1870,7 @@ static int qedr_update_qp_state(struct qedr_dev *dev,
 
                        if (rdma_protocol_roce(&dev->ibdev, 1)) {
                                wmb();
-                               writel(qp->rq.db_data.raw, qp->rq.db);
+                               writel_relaxed(qp->rq.db_data.raw, qp->rq.db);
                                /* Make sure write takes effect */
                                mmiowb();
                        }
@@ -3257,7 +3257,7 @@ int qedr_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
         * redundant doorbell.
         */
        wmb();
-       writel(qp->sq.db_data.raw, qp->sq.db);
+       writel_relaxed(qp->sq.db_data.raw, qp->sq.db);
 
        /* Make sure write sticks */
        mmiowb();