diff options
authorDaniel Thompson <daniel.thompson@linaro.org>2014-09-09 12:07:09 +0100
committerDaniel Thompson <daniel.thompson@linaro.org>2014-09-09 12:07:09 +0100
commit8cb7a8172cd19b09a49ee4efa298cdba5bf12acf (patch)
parent8d656f055800a15a6723af1f4782d93180d40350 (diff)
asm-generic/io.h: Implement read[bwlq]_relaxed()dev/readbwl_relaxed
Currently the read[bwlq]_relaxed() family are implemented on every architecture except blackfin, m68k[1], metag, openrisc, s390[2] and score. Increasingly drivers are being optimized to exploit relaxed reads putting these architectures at risk of compilation failures for shared drivers. This patch addresses this by providing implementations of read[bwlq]_relaxed() that are identical to the equivalent read[bwlq](). All the above architectures include asm-generic/io.h . Note that currently only eight architectures (alpha, arm, arm64, avr32, hexagon, microblaze, mips and sh) implement write[bwlq]_relaxed() meaning these functions are deliberately not included in this patch. [1] m68k includes the relaxed family only when configured *without* MMU. [2] s390 requires CONFIG_PCI to include the relaxed family. Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org> Cc: Will Deacon <will.deacon@arm.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: linux-arch@vger.kernel.org
1 files changed, 14 insertions, 0 deletions
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index 975e1cc75edb..85ea117c5e0d 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -66,6 +66,16 @@ static inline u32 readl(const volatile void __iomem *addr)
return __le32_to_cpu(__raw_readl(addr));
+#ifndef readb_relaxed
+#define readb_relaxed __raw_readb
+#ifndef readw_relaxed
+#define readw_relaxed readw
+#ifndef readl_relaxed
+#define readl_relaxed readl
#ifndef __raw_writeb
static inline void __raw_writeb(u8 b, volatile void __iomem *addr)
@@ -105,6 +115,10 @@ static inline u64 readq(const volatile void __iomem *addr)
return __le64_to_cpu(__raw_readq(addr));
+#ifndef readq_relaxed
+#define readq_relaxed readq
#ifndef __raw_writeq
static inline void __raw_writeq(u64 b, volatile void __iomem *addr)