Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1618993

Re: [PATCH] scsi: mpt3sas: remove redundant wmb on arm/arm64

From James Bottomley <jejb@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: [PATCH] scsi: mpt3sas: remove redundant wmb on arm/arm64
Date 2017-04-07 19:30 +0200
Message-ID <ttFRU-1SP-17@gated-at.bofh.it> (permalink)
References <ttFfb-1ms-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] scsi: mpt3sas: remove redundant wmb on arm/arm64 Sinan Kaya <okaya@codeaurora.org> - 2017-04-07 18:50 +0200
  Re: [PATCH] scsi: mpt3sas: remove redundant wmb on arm/arm64 Sinan Kaya <okaya@codeaurora.org> - 2017-04-07 19:00 +0200
  Re: [PATCH] scsi: mpt3sas: remove redundant wmb on arm/arm64 James Bottomley <jejb@linux.vnet.ibm.com> - 2017-04-07 19:30 +0200
    Re: [PATCH] scsi: mpt3sas: remove redundant wmb on arm/arm64 Sinan Kaya <okaya@codeaurora.org> - 2017-04-07 19:30 +0200

csiph-web