aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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)
treefa67c82a2f297e09c77aa27a1d2b2c52dd592779
parent8d656f055800a15a6723af1f4782d93180d40350 (diff)
downloadlinux-dev/readbwl_relaxed.tar.gz
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
-rw-r--r--include/asm-generic/io.h14
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
+#endif
+#ifndef readw_relaxed
+#define readw_relaxed readw
+#endif
+#ifndef readl_relaxed
+#define readl_relaxed readl
+#endif
+
#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
+#endif
+
#ifndef __raw_writeq
static inline void __raw_writeq(u64 b, volatile void __iomem *addr)
{