[ewg] Re: [PATCH 2/14] nes: device structures and defines

Jeff Garzik jeff at garzik.org
Wed Aug 8 12:40:39 PDT 2007


Michael Buesch wrote:
> On Wednesday 08 August 2007 18:59:08 Jeff Garzik wrote:
>> Michael Buesch wrote:
>>> writel doesn't guarantee flushing either.
>>> readl does.
>>
>> Not quite -- there are multiple kinds of flushing.  You're thinking 
>> about flushing across PCI bridges, which is correct, but you also have 
>> CPU write posting and CPU write ordering and such.
>>
>> Without taking all that into account, you might be tempted to think that 
>> __raw_readl() will perform all flushes necessary following a 
>> __raw_writel() -- but that would be incorrect.
> 
> So, kind of...
> Better use writel(swab32(...
> unless you like being shot into the foot.

Correct.

	Jeff






More information about the ewg mailing list