aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSinan Kaya <okaya@codeaurora.org>2018-04-06 14:02:45 -0400
committerArnd Bergmann <arnd@arndb.de>2018-04-10 10:37:21 -0400
commit8875c55437617fa4351070656bd78e17ed8284a5 (patch)
tree3becfe6342a176e9306179da665bb522d0fd6f3b
parent8d14f31ec9ac3e27fd451c23c760b59559c2ad27 (diff)
io: change readX_relaxed() to remove barriers
Now that we hardened readX() API in asm-generic version, readX_relaxed() API is violating the rules when readX_relaxed() == readX() in the default implementation. The relaxed API shouldn't have any barriers in it and it doesn't provide any ordering with respect to the memory transactions. The only requirement is for reads to be ordered with respect to each other. This is achieved by the volatile in the __raw_readX() API. Open code the relaxed API and remove any barriers in it. Signed-off-by: Sinan Kaya <okaya@codeaurora.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r--include/asm-generic/io.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index 578b6883dd6a..fa0975da0cec 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -252,19 +252,35 @@ static inline void writeq(u64 value, volatile void __iomem *addr)
252 * accesses. 252 * accesses.
253 */ 253 */
254#ifndef readb_relaxed 254#ifndef readb_relaxed
255#define readb_relaxed readb 255#define readb_relaxed readb_relaxed
256static inline u8 readb_relaxed(const volatile void __iomem *addr)
257{
258 return __raw_readb(addr);
259}
256#endif 260#endif
257 261
258#ifndef readw_relaxed 262#ifndef readw_relaxed
259#define readw_relaxed readw 263#define readw_relaxed readw_relaxed
264static inline u16 readw_relaxed(const volatile void __iomem *addr)
265{
266 return __le16_to_cpu(__raw_readw(addr));
267}
260#endif 268#endif
261 269
262#ifndef readl_relaxed 270#ifndef readl_relaxed
263#define readl_relaxed readl 271#define readl_relaxed readl_relaxed
272static inline u32 readl_relaxed(const volatile void __iomem *addr)
273{
274 return __le32_to_cpu(__raw_readl(addr));
275}
264#endif 276#endif
265 277
266#if defined(readq) && !defined(readq_relaxed) 278#if defined(readq) && !defined(readq_relaxed)
267#define readq_relaxed readq 279#define readq_relaxed readq_relaxed
280static inline u64 readq_relaxed(const volatile void __iomem *addr)
281{
282 return __le64_to_cpu(__raw_readq(addr));
283}
268#endif 284#endif
269 285
270#ifndef writeb_relaxed 286#ifndef writeb_relaxed