Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934523AbdDGRZq (ORCPT ); Fri, 7 Apr 2017 13:25:46 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:53879 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755497AbdDGRZk (ORCPT ); Fri, 7 Apr 2017 13:25:40 -0400 Subject: Re: [PATCH] scsi: mpt3sas: remove redundant wmb on arm/arm64 From: James Bottomley 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 Date: Fri, 07 Apr 2017 10:25:30 -0700 In-Reply-To: <1491583306-20551-1-git-send-email-okaya@codeaurora.org> References: <1491583306-20551-1-git-send-email-okaya@codeaurora.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.16.5 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17040717-2213-0000-0000-00000186A478 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006894; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000208; SDB=6.00844361; UDB=6.00416202; IPR=6.00622658; BA=6.00005275; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014953; XFM=3.00000013; UTC=2017-04-07 17:25:38 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17040717-2214-0000-0000-0000554EB140 Message-Id: <1491585930.2325.11.camel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-04-07_15:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1704070142 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1194 Lines: 26 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