[PATCH V3 42/63] ST SPEAr: replace readl, writel with __raw_readl, __raw_writel in uncompress.h

stanley.miao stanley.miao at windriver.com
Fri Jan 7 04:38:11 EST 2011


Russell King - ARM Linux wrote:
> On Fri, Jan 07, 2011 at 10:26:25AM +0800, stanley.miao wrote:
>   
>> Viresh Kumar wrote:
>>     
>>> readl also calls outer cache maintainance operations 
>>>       
>> I use readl here on spear13xx. It works fine.
>> This is the definition of readl, could you tell me which code calls  
>> outer cache maintainance ?
>>
>> #define readl(c) ({ __u32 __v = le32_to_cpu((__force __le32) \
>>                                        __raw_readl(__mem_pci(c))); __v; })
>>     
>
> #define readl(c)                ({ u32 __v = readl_relaxed(c); __iormb(); __v; })
>
> is how it's now defined, and __iormb() is defined to be rmb() on ARMv7+,
> which translates to a dmb.
>
> writel() on the other hand is less straight forward.  It uses __iowmb()
> which translates to a wmb() on ARMv7+, which is a dsb and an outer cache
> sync operation.  This will fail in the decompressor code as there's no
> outer cache support there.
>
>   
Hi, Russell, Thanks for your patient explanation.

With this in mind, I think readl_relaxed() should be better here.

Stanley.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110107/26ec7e42/attachment-0001.html>


More information about the linux-arm-kernel mailing list