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: 10296155 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 C8E8960385 for ; Tue, 20 Mar 2018 03:03:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8A81291B2 for ; Tue, 20 Mar 2018 03:03:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD491291BE; Tue, 20 Mar 2018 03:03:30 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 37E0B291B2 for ; Tue, 20 Mar 2018 03:03:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kFPeYsbPbk+q46xy08/deCKOILxEQuslsRTl4WzW6UA=; b=A0FlHpr+pvuunh fBahx5x0RQLyJWuRSdRkJF7sLEYFIh0TvdO9qk6zm4WxzrowhxjOZP9OlH8yqF5XWn1mG/QoDszX5 Lx0oFezEFkszkskEMwZ3mnCxVDjHM70gk92gfKk8JFiyuISrsLXaZYL1eRPZj7w4OLmrRGHEKFqJw TLWzi7F3dmKG56JOAafnZiA+I6W1XupbS51pVjeXqDDSQUahH4ex3Xm0HaoTCVLzP4MCTmD/53C5t 0FPffBh397Kylqosi092UFkFcOmz0y1hrDJXlX8gBqxYMGFEWk6le7mpjXqUCQTkNN03j1ophOcZC L0uLxU5u5TRprXKEW7Dw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ey7Yb-0006tc-PO; Tue, 20 Mar 2018 03:03:25 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1ey7VW-0003OI-Js for linux-arm-kernel@bombadil.infradead.org; Tue, 20 Mar 2018 03:00:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=dWyNgyAYxtpe7xZ6Tz9uEV4RwCr9T4v5voKBSmKqmWg=; b=nX4lkpCXqBHzTu5xhN6b0bYkIm 5C1QU9w8Pvilqgs0DDb4hCf5YVzGAYr1KWdcrM1VsNc53uOM4iLch6itjG1MFEaoaJVf96ysaibaB CnKPTdNlqd3zzwxgKi9wnWflO4sdGdqZ74KiEty94ey7h1pCbsRNmsgYRqwL2eWmydd0ytqctQgEU lm2PRm5rV+JU6NxtbjXGs6zJQGgD4RRIsss3gF7bMrXj6yaZYP3ELEgZomWZUiLFod8mSBV4CmfoT fqFHEQafN+a5crQhmouXoRS5IiWy3piOsTJM8iQ0yvWzgnBWorfzeyuXOQdeXA//vOWx/pp48SO3p IFFov8lA==; Received: from smtp.codeaurora.org ([198.145.29.96]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1ey7Jo-0000hM-8m for linux-arm-kernel@lists.infradead.org; Tue, 20 Mar 2018 02:48:09 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 4EBC560F61; Tue, 20 Mar 2018 02:47:57 +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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180320_024808_441216_2920BDDD X-CRM114-Status: GOOD ( 11.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, Yishai Hadas , linux-kernel@vger.kernel.org, Sinan Kaya , Jason Gunthorpe , Doug Ledford , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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