IB/mlx4: Eliminate duplicate barriers on weakly-ordered archs
authorSinan Kaya <okaya@codeaurora.org>
Tue, 20 Mar 2018 02:47:44 +0000 (22:47 -0400)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 21 Mar 2018 19:51:41 +0000 (13:51 -0600)
Code includes wmb() followed by writel(). 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>
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/mlx4/qp.c

index 04efc05fb5313de0359d13f7605e9acc95b237f1..523028e944ed2dd87862c9093c26d995f6f29d59 100644 (file)
@@ -3894,8 +3894,8 @@ out:
                 */
                wmb();
 
-               writel(qp->doorbell_qpn,
-                      to_mdev(ibqp->device)->uar_map + MLX4_SEND_DOORBELL);
+               writel_relaxed(qp->doorbell_qpn,
+                       to_mdev(ibqp->device)->uar_map + MLX4_SEND_DOORBELL);
 
                /*
                 * Make sure doorbells don't leak out of SQ spinlock