* [PATCH] MIPS: io: add a barrier after readX()
@ 2018-04-02 18:10 Sinan Kaya
0 siblings, 0 replies; only message in thread
From: Sinan Kaya @ 2018-04-02 18:10 UTC (permalink / raw)
To: linux-arm-kernel
While a barrier is present in writeX() function before the register write,
a similar barrier is missing in the readX() function after the register
read. This could allow register accesses following readX() to observe
stale data.
Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Reported-by: Arnd Bergmann <arnd@arndb.de>
---
arch/mips/include/asm/io.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h
index 0cbf3af..7f9068d 100644
--- a/arch/mips/include/asm/io.h
+++ b/arch/mips/include/asm/io.h
@@ -377,6 +377,7 @@ static inline type pfx##read##bwlq(const volatile void __iomem *mem) \
BUG(); \
} \
\
+ war_io_reorder_wmb(); \
return pfx##ioswab##bwlq(__mem, __val); \
}
--
2.7.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-04-02 18:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-02 18:10 [PATCH] MIPS: io: add a barrier after readX() Sinan Kaya
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).