From: Sinan Kaya Date: Tue, 20 Mar 2018 02:47:44 +0000 (-0400) Subject: IB/mlx4: Eliminate duplicate barriers on weakly-ordered archs X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=97d82a48d7a7eca6f20b100ae19811134509406e;p=linux.git IB/mlx4: Eliminate duplicate barriers on weakly-ordered archs 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 Reviewed-by: Jason Gunthorpe Signed-off-by: Jason Gunthorpe --- diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c index 04efc05fb5313..523028e944ed2 100644 --- a/drivers/infiniband/hw/mlx4/qp.c +++ b/drivers/infiniband/hw/mlx4/qp.c @@ -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