From: Daniel Thompson <daniel.thompson@linaro.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Daniel Thompson <daniel.thompson@linaro.org>,
linux-kernel@vger.kernel.org, patches@linaro.org,
linaro-kernel@lists.linaro.org, Will Deacon <will.deacon@arm.com>,
linux-arch@vger.kernel.org
Subject: [PATCH] asm-generic/io.h: Implement read[bwlq]_relaxed()
Date: Tue, 9 Sep 2014 13:12:40 +0100 [thread overview]
Message-ID: <1410264760-29756-1-git-send-email-daniel.thompson@linaro.org> (raw)
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
---
include/asm-generic/io.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index 975e1cc..85ea117 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)
{
--
1.9.3
next reply other threads:[~2014-09-09 12:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-09 12:12 Daniel Thompson [this message]
2014-09-09 12:28 ` [PATCH] asm-generic/io.h: Implement read[bwlq]_relaxed() Will Deacon
2014-09-09 13:03 ` Daniel Thompson
2014-09-09 13:14 ` Daniel Thompson
2014-09-09 13:14 ` Daniel Thompson
2014-09-09 14:15 ` Will Deacon
2014-09-09 14:51 ` Daniel Thompson
2014-09-09 12:31 ` Geert Uytterhoeven
2014-09-09 13:11 ` Daniel Thompson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1410264760-29756-1-git-send-email-daniel.thompson@linaro.org \
--to=daniel.thompson@linaro.org \
--cc=arnd@arndb.de \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@linaro.org \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).