Received: by 10.213.65.68 with SMTP id h4csp478145imn; Tue, 20 Mar 2018 07:50:45 -0700 (PDT) X-Google-Smtp-Source: AG47ELu6M3yon1/Vvp9iWCebb5aa7fisjByYChH566K6+wJpO0hUScJMSUhaBkBzqykfKXUFGzfs X-Received: by 2002:a17:902:b943:: with SMTP id h3-v6mr16851569pls.1.1521557445216; Tue, 20 Mar 2018 07:50:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521557445; cv=none; d=google.com; s=arc-20160816; b=nnl2JUjBqfILVPKS4fCQNrvGZklh+TMIXB8wzghuPAT79roZ2yOohigzazREroa/nc OdMFDiXZ074id6W6LtitPpQ5znXMZovqnVMPV4bnJyMw6cGIOTS+uRpEwr1YTdqe3g8D pledqxH+WHQ3pj1c6X68mhtjKiR2TW3lzTG//sa0S9JsrJQ+oP14KRJwxxCy93oPDQ7b n9Sp/NjH2u6JlNkykzCm3QLPSKF/5VuI4ovh7M7YOGvUGj8fHSZxwodogBN32mGy2jfR xpTAWvQA20lQx95h3eJoPfldaeLwsxQFMZkFklSwxUXnWMifPgXWknVVc9HtCKDn2gll l5zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=18sNwQHBGrZtLh5u2H481NCRL4iSj4kGjR1ARu978/w=; b=XiRtpUlqxk64FfVME+0psIy2Jz3X9f1hgIqe18Kn5dA3Z8qaY+Pw7KJDD91k3nROfh IyctH/8OXXHYL8qM3hiRwcDX1zu2TpUXjcSPXhQY+SDMA3l348PiKrxMVuYYgdO5RpJs V8U9WNoGGdag/EVOagihsRywd6rPOhvfReLZWjVwQ5rX+o0CK0c4aPr3YE7rBkReVM/X 21wKC4XBHJDJc5KaUTQMK8TqdXNLf39TFW0wN4mk7LUbyk9+2KnkUCaNVKFQT352tEJy Cdd2VrgwGf1G8+nr2MgorCoHOqaEa45fXwLxkhTgQFO6CAv3JL9zmCEnYKoA7hCee0Ue QclA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=kWbBgHIm; 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 h188si1296814pgc.330.2018.03.20.07.50.30; Tue, 20 Mar 2018 07:50:45 -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=@ziepe.ca header.s=google header.b=kWbBgHIm; 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 S1751778AbeCTOtD (ORCPT + 99 others); Tue, 20 Mar 2018 10:49:03 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:34694 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751499AbeCTOs4 (ORCPT ); Tue, 20 Mar 2018 10:48:56 -0400 Received: by mail-wm0-f66.google.com with SMTP id a20so17676875wmd.1 for ; Tue, 20 Mar 2018 07:48:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=18sNwQHBGrZtLh5u2H481NCRL4iSj4kGjR1ARu978/w=; b=kWbBgHIm/75vp79EnPWIe+jZXXacNyxoMTeQSMOQQ/CYfkDRqYghArz+hH9VPFnLbU gtTM+1nGMKsePZNnukix2c3M9MOcKBBPiZ79B6ty8cq/8Fttcpr2Gsag8GG8+9iNRvJ4 oFcVi9+ceYTRb/L2NhFiDazDmyKtsoN12IaY3rGk4yDpAqaVmNH+D/z5a4yyRtZ3vOBH jYz8wnQdAvXLHnsWEln9lyIuHoCkuvXl37pIvj9aTSQmRmsPh/anaiG+B/+Ky70Hptdq j9RIQj4vZeLTd0iqxfhe6fT2ZPdVLB4CkUVlcC1gL3fXtcUEMVLjoC/zdU75pqUj7O+R pTZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=18sNwQHBGrZtLh5u2H481NCRL4iSj4kGjR1ARu978/w=; b=b5O97r+zruR3meIIQQ550kwFjZfCUOmfIeGrXMjIflChJpbCOXggnM2+VbpLE5b/hU 2hfpHIkwBI6uyywKvX8iZr8pUmhOn34NB+9Qlp04UwG/VojSncI8cNUOQCXpvaFcgC7k B+56OAYpCx28G0NfUwbxqOVh9fri+/9n/+w2CVAPFE+iI66PSx+x50gJI67h5NYharkW utG8R5Zy+ASrW8Ug0HuSDrjRjoCq59vWrdyAgQIi+LqlNaZavSphiE6Y9DnMqlXoLgcU SfIJoWN6SA2VqXK5zG5vw1b+WkBuWVB/n+57tblFYPVfXZj3EGOuFImrTH9BYI0TnnlE I2Bg== X-Gm-Message-State: AElRT7GHxTztDNaI0aDhLhSZolfmY/NEkdB12iLvHJz4COqn1RFkJmRi qsHSw7QFRUi+UD4hPEBoH5iz+g== X-Received: by 10.28.151.5 with SMTP id z5mr13033wmd.28.1521557335565; Tue, 20 Mar 2018 07:48:55 -0700 (PDT) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [174.3.196.123]) by smtp.gmail.com with ESMTPSA id 59sm1647653wrj.5.2018.03.20.07.48.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Mar 2018 07:48:54 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from ) id 1eyIZH-00067Q-3w; Tue, 20 Mar 2018 08:48:51 -0600 Date: Tue, 20 Mar 2018 08:48:51 -0600 From: Jason Gunthorpe To: Sinan Kaya Cc: linux-rdma@vger.kernel.org, timur@codeaurora.org, sulrich@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Yishai Hadas , Doug Ledford , linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 2/6] IB/mlx4: Eliminate duplicate barriers on weakly-ordered archs Message-ID: <20180320144851.GF19744@ziepe.ca> References: <1521514068-8856-1-git-send-email-okaya@codeaurora.org> <1521514068-8856-3-git-send-email-okaya@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1521514068-8856-3-git-send-email-okaya@codeaurora.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 19, 2018 at 10:47:44PM -0400, Sinan Kaya wrote: > 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(-) Reviewed-by: Jason Gunthorpe > 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 >