Received: by 10.213.65.68 with SMTP id h4csp66187imn; Mon, 19 Mar 2018 19:51:04 -0700 (PDT) X-Google-Smtp-Source: AG47ELvAnB8zPSZqrAKS+8ESL0yViLf6uErK1aAcfygZEc+jH5j6xb7+juPG9bfk4TkTpt3qxo3V X-Received: by 10.101.100.89 with SMTP id s25mr10528245pgv.401.1521514264454; Mon, 19 Mar 2018 19:51:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521514264; cv=none; d=google.com; s=arc-20160816; b=Vc2gr5r1BwC1OMOfq6HXtn21IwwgpGgpT/KcMyATMV3u4+CQPJPnbaxNOLVxXNE7IU dPD7R3h2uahMh17cacQnIa/4efXCFNqa8Jvt+1pnUkj16ujMqDT3EdCRNJi9nzKcBcZp eBVBvpe3rTfOrKpJEYmN4CJReFAgY7wgBsxCNlazWgnkSg8TzNJ5SGGLmFB8ubd8/Btz KzGFy2UcBw/Z0IdZqzmiMyG57qq7OzgSmJj7/f9Kg6SiWu5yWexuKSXt60mUqUJht0f5 V4/yjdBbCHoM24YTPflEJTyO2WAC00E7tSJKB+3wgasHK4g21HAfLFME1WuJjtfA1gZG VRzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=dWyNgyAYxtpe7xZ6Tz9uEV4RwCr9T4v5voKBSmKqmWg=; b=EDtII3yKfBT8EKRYHbfmQpKun9z3FEBSDyjm+LhHSMINFxFZ1iiWCit9ta2D5bX96H DCZEXgMxT5hK/ILclDm5mwMMWJf/hPCNsFWmGDGT3LzelxAgNuF7OMacwJcq/nuOftl7 Nf0R7AZ2MXs226eu/iWS7Rm36D/HW0+SpoutBAUYSkl0zE/T5wPWtnECsHg4D42GGHPm d5smEfaZBFNbYZPMBWtYsVrvfCuB3OhZgyML4nJH+83EnzqfpQAsW7Oo4DGvzhtFX/vS Q6pgzUmPCBUoLJzu6CSwJAQIjdvMC1Nepgzxe/xfUscpPMhVW6n5Z2e75hdgJx3vP7rE P6zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=Jnc26fXp; dkim=pass header.i=@codeaurora.org header.s=default header.b=LDjw8kjZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n6si454107pgc.801.2018.03.19.19.50.50; Mon, 19 Mar 2018 19:51:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=Jnc26fXp; dkim=pass header.i=@codeaurora.org header.s=default header.b=LDjw8kjZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752060AbeCTCuE (ORCPT + 99 others); Mon, 19 Mar 2018 22:50:04 -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= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 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 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 -- 2.7.4