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>
This commit is contained in:
Sinan Kaya 2018-04-06 14:02:45 -04:00 коммит произвёл Arnd Bergmann
Родитель 8d14f31ec9
Коммит 8875c55437
1 изменённых файлов: 20 добавлений и 4 удалений

Просмотреть файл

@ -252,19 +252,35 @@ static inline void writeq(u64 value, volatile void __iomem *addr)
* accesses. * accesses.
*/ */
#ifndef readb_relaxed #ifndef readb_relaxed
#define readb_relaxed readb #define readb_relaxed readb_relaxed
static inline u8 readb_relaxed(const volatile void __iomem *addr)
{
return __raw_readb(addr);
}
#endif #endif
#ifndef readw_relaxed #ifndef readw_relaxed
#define readw_relaxed readw #define readw_relaxed readw_relaxed
static inline u16 readw_relaxed(const volatile void __iomem *addr)
{
return __le16_to_cpu(__raw_readw(addr));
}
#endif #endif
#ifndef readl_relaxed #ifndef readl_relaxed
#define readl_relaxed readl #define readl_relaxed readl_relaxed
static inline u32 readl_relaxed(const volatile void __iomem *addr)
{
return __le32_to_cpu(__raw_readl(addr));
}
#endif #endif
#if defined(readq) && !defined(readq_relaxed) #if defined(readq) && !defined(readq_relaxed)
#define readq_relaxed readq #define readq_relaxed readq_relaxed
static inline u64 readq_relaxed(const volatile void __iomem *addr)
{
return __le64_to_cpu(__raw_readq(addr));
}
#endif #endif
#ifndef writeb_relaxed #ifndef writeb_relaxed