RE: [PATCH v2] locking/memory-barriers.txt: Improve documentation for writel() example

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> From: Bagas Sanjaya <bagasdotme@xxxxxxxxx>
> Sent: Thursday, October 6, 2022 7:31 AM
> 
> On 10/5/22 17:47, Parav Pandit wrote:
> > @@ -1927,10 +1927,12 @@ There are some more advanced barrier
> functions:
> >       before we read the data from the descriptor, and the dma_wmb()
> allows
> >       us to guarantee the data is written to the descriptor before the device
> >       can see it now has ownership.  The dma_mb() implies both a
> dma_rmb() and
> > -     a dma_wmb().  Note that, when using writel(), a prior wmb() is not
> needed
> > -     to guarantee that the cache coherent memory writes have completed
> before
> > -     writing to the MMIO region.  The cheaper writel_relaxed() does not
> provide
> > -     this guarantee and must not be used here.
> > +     a dma_wmb().  Note that, when using writel(), a prior barrier is not
> > +     needed to guarantee that the cache coherent memory writes have
> completed
> > +     before writing to the MMIO region.  The cheaper writel_relaxed() does
> not
> > +     provide this guarantee and must not be used here. Hence, writeX() is
> always
> > +     preferred which inserts needed platform specific barrier before writing
> to
> > +     the specified MMIO region.
> >
> 
> Did you mean that writeX() is write() function family?
Yes.




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux