RFC on writel and writel_relaxed

Arnd Bergmann arnd at arndb.de
Tue Mar 27 06:44:15 AEDT 2018

On Mon, Mar 26, 2018 at 6:54 PM, Jason Gunthorpe <jgg at ziepe.ca> wrote:
> On Mon, Mar 26, 2018 at 11:08:45AM +0000, David Laight wrote:
>> > > This is a super performance critical operation for most drivers and
>> > > directly impacts network performance.
>> Perhaps there ought to be writel_nobarrier() (etc) that never contain
>> any barriers at all.
>> This might mean that they are always just the memory operation,
>> but it would make it more obvious what the driver was doing.
> I think that is what writel_relaxed is supposed to be.
> The only restriction it has is that the writes to a single device
> using UC memory must be kept in program order..

Not sure about whether we have ever defined what happens to
writel_relaxed() on WC memory though: On ARM, we disallow
the compiler to combine writes, but the CPU still might.

It's also not entirely clear to me what we want writel() inside a
spinlock to mean: should the spinlock guarantee that two writel()
calls on different CPUs that are protected by spinlocks are
serialized by those locks, or not?


More information about the Linuxppc-dev mailing list