MIPS: CM: use __raw_ memory access functions
authorPaul Burton <paul.burton@imgtec.com>
Mon, 24 Mar 2014 10:19:34 +0000 (10:19 +0000)
committerRalf Baechle <ralf@linux-mips.org>
Mon, 31 Mar 2014 16:17:13 +0000 (18:17 +0200)
The CM registers use native endianness, so using plain readl & writel
will produce incorrect results on big endian systems.

Reported-by: Jeffrey Deans <jeffrey.deans@imgtec.com>
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/6656/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/include/asm/mips-cm.h

index 12cae5e294c43ae159c3fa75768c110586be928f..6a9d2dd005cad8755e77b6a21fc187070312bf86 100644 (file)
@@ -96,13 +96,13 @@ static inline u32 *addr_gcr_##name(void)                    \
                                                                \
 static inline u32 read_gcr_##name(void)                                \
 {                                                              \
-       return readl(addr_gcr_##name());                        \
+       return __raw_readl(addr_gcr_##name());                  \
 }
 
 #define BUILD_CM__W(name, off)                                 \
 static inline void write_gcr_##name(u32 value)                 \
 {                                                              \
-       writel(value, addr_gcr_##name());                       \
+       __raw_writel(value, addr_gcr_##name());                 \
 }
 
 #define BUILD_CM_RW(name, off)                                 \