Commit a71e7c44 authored by Sinan Kaya's avatar Sinan Kaya Committed by Arnd Bergmann

io: change writeX_relaxed() to remove barriers

Now that we hardened writeX() API in asm-generic version, writeX_relaxed()
API is violating the rules when writeX_relaxed() == writeX() 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 writes to be ordered with respect to each other. This is achieved
by the volatile in the __raw_writeX() API.

Open code the relaxed API and remove any barriers in it.
Signed-off-by: default avatarSinan Kaya <okaya@codeaurora.org>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 8875c554
...@@ -284,19 +284,35 @@ static inline u64 readq_relaxed(const volatile void __iomem *addr) ...@@ -284,19 +284,35 @@ static inline u64 readq_relaxed(const volatile void __iomem *addr)
#endif #endif
#ifndef writeb_relaxed #ifndef writeb_relaxed
#define writeb_relaxed writeb #define writeb_relaxed writeb_relaxed
static inline void writeb_relaxed(u8 value, volatile void __iomem *addr)
{
__raw_writeb(value, addr);
}
#endif #endif
#ifndef writew_relaxed #ifndef writew_relaxed
#define writew_relaxed writew #define writew_relaxed writew_relaxed
static inline void writew_relaxed(u16 value, volatile void __iomem *addr)
{
__raw_writew(cpu_to_le16(value), addr);
}
#endif #endif
#ifndef writel_relaxed #ifndef writel_relaxed
#define writel_relaxed writel #define writel_relaxed writel_relaxed
static inline void writel_relaxed(u32 value, volatile void __iomem *addr)
{
__raw_writel(__cpu_to_le32(value), addr);
}
#endif #endif
#if defined(writeq) && !defined(writeq_relaxed) #if defined(writeq) && !defined(writeq_relaxed)
#define writeq_relaxed writeq #define writeq_relaxed writeq_relaxed
static inline void writeq_relaxed(u64 value, volatile void __iomem *addr)
{
__raw_writeq(__cpu_to_le64(value), addr);
}
#endif #endif
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment