Commit e7b720ef authored by Sinan Kaya's avatar Sinan Kaya Committed by Greg Kroah-Hartman

MIPS: io: Add barrier after register read in readX()

[ Upstream commit a1cc7034 ]

While a barrier is present in the writeX() functions before the register
write, a similar barrier is missing in the readX() functions after the
register read. This could allow memory accesses following readX() to
observe stale data.
Signed-off-by: default avatarSinan Kaya <>
Reported-by: default avatarArnd Bergmann <>
Cc: Ralf Baechle <>
Cc: Paul Burton <>
[ Tidy commit message]
Signed-off-by: default avatarJames Hogan <>
Signed-off-by: default avatarSasha Levin <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent dc94ac5f
......@@ -377,6 +377,8 @@ static inline type pfx##read##bwlq(const volatile void __iomem *mem) \
BUG(); \
} \
/* prevent prefetching of coherent DMA data prematurely */ \
rmb(); \
return pfx##ioswab##bwlq(__mem, __val); \
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment