RFC on writel and writel_relaxed
David.Laight at ACULAB.COM
Wed Mar 28 00:20:44 AEDT 2018
> Fair enough. I'd rather people used _relaxed by default, but I have to admit
> that it will probably just result in them getting things wrong...
Certainly requiring the driver writes use explicit barriers should make
them understand when and why they are needed - and then put in the correct ones.
The problem I've had is that I have a good idea which barriers are needed
but find that readl/writel seem to contain a lot of extra ones.
Maybe the are required in some places, but the extra synchronising
instructions could easily have measureable performance effects on
Drivers are likely to contain sequences like:
if (...) return
for things like ring updates.
Where the 'mem' might actually be in io space.
In such sequences not all the synchronising instructions are needed.
I'm not at all sure it is easy to get the right set.
More information about the Linuxppc-dev