From patchwork Tue Mar 20 02:47:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 10296073 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6D3F7602C2 for ; Tue, 20 Mar 2018 02:50:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DDE928E94 for ; Tue, 20 Mar 2018 02:50:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 527F128F5F; Tue, 20 Mar 2018 02:50:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBEFA28E94 for ; Tue, 20 Mar 2018 02:50:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751249AbeCTCuD (ORCPT ); Mon, 19 Mar 2018 22:50:03 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:55882 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752206AbeCTCr7 (ORCPT ); Mon, 19 Mar 2018 22:47:59 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 7FD7860FEA; Tue, 20 Mar 2018 02:47:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521514078; bh=C7ppIVAn7oBg48ynG45Ehi411LvHhXrVvznztRVFPXE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jnc26fXp8sJfCfBGgaALDtJgOlLiKONuwevmZIm0108S0DlsewuYTF0kDE20oZX8F dKebVsNHjvaBhJba4ty/MBRHvXt2srYysfrOjrzuiA0CDLQ3HcTr8GNnGbKLXKfqYg lV2iu4Y2J8vO3oZSvnuoWKWhFgzIQN0QLSPbnvlw= Received: from drakthul.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 2B0D760F6B; Tue, 20 Mar 2018 02:47:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521514077; bh=C7ppIVAn7oBg48ynG45Ehi411LvHhXrVvznztRVFPXE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LDjw8kjZBMkon48tnOah7IX3MrX4WdzCB1xDNSHji8+llKQXsmGNln/+KlOlQJCbI 3nVtkMDzpj1upXPhNEscRG4iFBDgOB7GNg07CwKQ2XhDqzUE5PmYqnwJzy4h3dhe0B 96AFWnEi3Xp4FLibR9gAMHhqf1Uh1EWEQJ5qSjpE= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 2B0D760F6B Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=okaya@codeaurora.org From: Sinan Kaya To: linux-rdma@vger.kernel.org, timur@codeaurora.org, sulrich@codeaurora.org Cc: linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sinan Kaya , Yishai Hadas , Doug Ledford , Jason Gunthorpe , linux-kernel@vger.kernel.org Subject: [PATCH v4 2/6] IB/mlx4: Eliminate duplicate barriers on weakly-ordered archs Date: Mon, 19 Mar 2018 22:47:44 -0400 Message-Id: <1521514068-8856-3-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521514068-8856-1-git-send-email-okaya@codeaurora.org> References: <1521514068-8856-1-git-send-email-okaya@codeaurora.org> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/infiniband/hw/mlx4/qp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c index f045491..74b27b0 100644 --- a/drivers/infiniband/hw/mlx4/qp.c +++ b/drivers/infiniband/hw/mlx4/qp.c @@ -3880,8 +3880,8 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, */ 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