On Mon, Jul 21, 2014 at 06:01:51PM +0200, Arnd Bergmann wrote:
The correct way to do it is to use the readl()/writel() functions, or readl_relaxed()/writel_relaxed() in case of drivers that don't need to synchronize with DMA transfers.
And don't need to build on minority platforms like x86 either!
I think what you want is something like
static inline void __hw_set_bit(int nr, unsigned long __iomem *addr) { addr += BIT_WORD(nr); writel_relaxed(readl_relaxed(addr) | BIT_MASK(nr), addr); }
which is also endian-safe.
Indeed, good point.