From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Bottomley Subject: Re: [PATCH] scsi: mpt3sas: remove redundant wmb on arm/arm64 Date: Fri, 07 Apr 2017 10:25:30 -0700 Message-ID: <1491585930.2325.11.camel@linux.vnet.ibm.com> References: <1491583306-20551-1-git-send-email-okaya@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:52929 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755507AbdDGRZk (ORCPT ); Fri, 7 Apr 2017 13:25:40 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v37HOPp3094046 for ; Fri, 7 Apr 2017 13:25:39 -0400 Received: from e11.ny.us.ibm.com (e11.ny.us.ibm.com [129.33.205.201]) by mx0a-001b2d01.pphosted.com with ESMTP id 29p7c422tr-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 07 Apr 2017 13:25:39 -0400 Received: from localhost by e11.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 7 Apr 2017 13:25:38 -0400 In-Reply-To: <1491583306-20551-1-git-send-email-okaya@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Sinan Kaya , linux-scsi@vger.kernel.org, timur@codeaurora.org Cc: linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sathya Prakash , Chaitra P B , Suganath Prabu Subramani , "Martin K. Petersen" , "open list:LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI)" , open list On Fri, 2017-04-07 at 12:41 -0400, Sinan Kaya wrote: > Due to relaxed ordering requirements on multiple architectures, > drivers are required to use wmb/rmb/mb combinations when they > need to guarantee observability between the memory and the HW. > > The mpt3sas driver is already using wmb() for this purpose. > However, it issues a writel following wmb(). writel() function > on arm/arm64 arhictectures have an embedded wmb() call inside. > > This results in unnecessary performance loss and code duplication. > > The kernel has been updated to support relaxed read/write > API to be supported across all architectures now. > > The right thing was to either call __raw_writel/__raw_readl or > write_relaxed/read_relaxed for multi-arch compatibility. writeX_relaxed and thus your patch is definitely wrong. The reason is that we have two ordering domains: the CPU and the Bus. wmb forces ordering in the CPU domain but not the bus domain. writeX originally forced ordering in the bus domain but not the CPU domain, but since the raw primitives I think it now orders in both and writeX_relaxed orders in neither domain, so your patch would currently eliminate the bus ordering. James