Skip to contentSkip to conversation

MIPS: io: add a barrier after readX()

PATCH Superseded Sinan Kaya 1 participant 1 message Apr 2, 2018

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Sinan Kaya

author
#0 lore raw

PATCH 1/1 MIPS: io: add a barrier after readX()

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.

---
 arch/mips/include/asm/io.h | 1 +
 1 file changed, 1 insertion(+)
arch/mips/include/asm/io.h +1 -0
index 0cbf3af..7f9068d 100644
@@ -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);				\
 }
 
Signature · 1 line
2.7.4