Received: by 10.213.65.68 with SMTP id h4csp570796imn; Tue, 20 Mar 2018 09:53:18 -0700 (PDT) X-Google-Smtp-Source: AG47ELvDRdmx416o7menM4CAKEvQPqy96MEvahL1AbILdj/MWqq7DeDr5BGv/r7TLr6qsLeAQvnJ X-Received: by 10.99.127.75 with SMTP id p11mr12289080pgn.392.1521564798203; Tue, 20 Mar 2018 09:53:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521564798; cv=none; d=google.com; s=arc-20160816; b=oQnMyPa01UkpSXOHFDwzC1MQBDeYXz22qfhaQ9OZXiPZx2MEmwLHTXKnStafTiw1j9 MCAJ/dnIVSHGQbq2vIi/d0sBPZig04fjS4yLIrGAcbVr1yTY+TdlzAye04joWMhSsPLn PZcq5EQkIVTmCtpwmgRkbJmpQDKnS73zkEcYftKI91BaJb8UaacripzY8R0q+Vw6B7/4 I/dkpeDSY6CHNFEYgXC+/F9JXWOFmQsgqFB0C1/11BAJd6W5dU37hbRvP4rXiRyTvL2Y gIT6V9MGdibcYM5NlqkADmepPk2IoAUP8y5DW1zYbtmlHtWulFtgFAD2aEAFA28lHyeC FehQ== 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:date:cc:to:from:subject:message-id :arc-authentication-results; bh=ef2AAb7mRllEFw4AtwDMKHcmOZXvQ4soKNFdKT2hRUA=; b=YJanCk5R6MZmIuk1XLw++9nTaXaBTl7tT43l6DBnAunQSraco7aoUSp+G2gsoIA74E aUSpem81V4Xh1a3goZDg/tywpeOaO/hBlh9lz/UgR9ohmd5jouqUxbn6J7JjpTSSREQg VnJzPFF/A2ELHC1//qVLRmbFB84iHQ6F1/mMizz+FdzXg8d4xk4r+BJ3z3J+3atMTUHK MHI8pcSmXiuAEnEQ3NhXoI4UCKT5F0Afvq1JKl+88+T8OfrvGxTM6K+ccqr7oKG1fbmu FljmuPXg6PwiCcBVFZSbowpcbnkviGyu1oRTIpvDil92r6Ve1wfQ7Rx3hT9y+eGgEXnL N8Ag== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q2-v6si2014347plh.259.2018.03.20.09.52.55; Tue, 20 Mar 2018 09:53:18 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751533AbeCTQwF (ORCPT + 99 others); Tue, 20 Mar 2018 12:52:05 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:46818 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751317AbeCTQwB (ORCPT ); Tue, 20 Mar 2018 12:52:01 -0400 Received: by mail-qk0-f193.google.com with SMTP id o184so2374153qkd.13 for ; Tue, 20 Mar 2018 09:52:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=ef2AAb7mRllEFw4AtwDMKHcmOZXvQ4soKNFdKT2hRUA=; b=tfFLq9i/V+ELIc195VOyzbGK9C3wPQEEzKR4EKIzhsePeKltkKd6tvLigsbQLDxt4l H1gu8k3reRbuMJ/z524uG8OneoVDAsQKX4yxFJkKBxyTIIYwmrJJhJq32vLoQUNI6bhA M9dXQe0MiYgSkEnHKEcP+AnFcFVDX60n8wG/Qn+R4WnsmyGx2ltFJDA9RHXiuqx88VMX fG1nIjp+kZIF5ydw64y6gKjfdIIu4dvWVlECaoA5pmCisdFEPLlIvQgRLVx4EJraz37j taTWVyDyAogFsGvTFdhjqnikAG70XRd3VN11+Wb8kZPDezecXzys/OTAL5jq+zMJj5gw r1Lg== X-Gm-Message-State: AElRT7FX5IHvD9jPZrhzD3G0tkLbZ5JTTf3PUU7VxExIzRTH0mTtBic0 /JtkqaJldI9Lb6lkVm3KXk0gUQ== X-Received: by 10.55.43.4 with SMTP id r4mr24888004qkh.356.1521564720301; Tue, 20 Mar 2018 09:52:00 -0700 (PDT) Received: from loberhel74 (71-88-101-235.dhcp.oxfr.ma.charter.com. [71.88.101.235]) by smtp.gmail.com with ESMTPSA id 61sm1465220qtc.49.2018.03.20.09.51.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Mar 2018 09:51:59 -0700 (PDT) Message-ID: <1521564718.13995.1.camel@redhat.com> Subject: Re: [PATCH v4 1/7] scsi: hpsa: Eliminate duplicate barriers on weakly-ordered archs From: Laurence Oberman To: Sinan Kaya , linux-scsi@vger.kernel.org, timur@codeaurora.org, sulrich@codeaurora.org Cc: linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Don Brace , "James E.J. Bottomley" , "Martin K. Petersen" , esc.storagedev@microsemi.com, linux-kernel@vger.kernel.org Date: Tue, 20 Mar 2018 12:51:58 -0400 In-Reply-To: <1521514207-10695-2-git-send-email-okaya@codeaurora.org> References: <1521514207-10695-1-git-send-email-okaya@codeaurora.org> <1521514207-10695-2-git-send-email-okaya@codeaurora.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6 (3.22.6-10.el7) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2018-03-19 at 22:50 -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/scsi/hpsa.h | 2 +- >  1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h > index 018f980..c7d7e6a 100644 > --- a/drivers/scsi/hpsa.h > +++ b/drivers/scsi/hpsa.h > @@ -599,7 +599,7 @@ static unsigned long > SA5_ioaccel_mode1_completed(struct ctlr_info *h, u8 q) >    * but with current driver design this is easiest. >    */ >   wmb(); > - writel((q << 24) | rq->current_entry, h->vaddr + > + writel_relaxed((q << 24) | rq->current_entry, h- > >vaddr + >   IOACCEL_MODE1_CONSUMER_INDEX); >   atomic_dec(&h->commands_outstanding); >   } This looks like it would work for the x86_64 and arm because of how its defined architecture specific for the x86_64 and the arm64 I guess its up to Don and the driver folks and if its worth the change. I am generally not a fan of messing with these barrier things though. Reviewed-by: Laurence Oberman