On Sat, 9 Sep 2006, Paul Mackerras wrote:Do you have an opinion about whether the MMIO write in writel() should
be ordered with respect to preceding writes to normal memory?
It shouldn't. It's too expensive. The fact that PC's have nice memory consistency models means that most of the testing is going to be with the PC memory ordering, but the same way we have "smp_wmb()" (which is also a no-op on x86) we should probably have a "mmiowb()" there.
Gaah. Right now, mmiowb() is actually broken on x86 (it's an empty define, so it may cause compiler warnings about statements with no effects or something).
I don't think anyting but a few SCSI drivers that are used on some ia64 boxes use mmiowb(). And it's currently a no-op not only on x86 but also on powerpc. Probably because it's defined to be a barrier between _two_ MMIO operations, while we should probably have things like