All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/2] MIPS: io: prevent compiler reordering on the default writeX() implementation
@ 2018-04-03 12:55 ` Sinan Kaya
  0 siblings, 0 replies; 40+ messages in thread
From: Sinan Kaya @ 2018-04-03 12:55 UTC (permalink / raw)
  To: linux-mips, arnd, timur, sulrich
  Cc: linux-arm-msm, linux-arm-kernel, Sinan Kaya, Ralf Baechle,
	James Hogan, Paul Burton, linux-kernel

writeX() has a strong ordering semantics with respect to memory updates.
In the abscence of a write barrier or a compiler barrier, commpiler can
reorder register and memory update instructions. This breaks the writeX()
API.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 arch/mips/include/asm/io.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h
index 0cbf3af..fd00ddaf 100644
--- a/arch/mips/include/asm/io.h
+++ b/arch/mips/include/asm/io.h
@@ -307,7 +307,7 @@ static inline void iounmap(const volatile void __iomem *addr)
 #if defined(CONFIG_CPU_CAVIUM_OCTEON) || defined(CONFIG_LOONGSON3_ENHANCEMENT)
 #define war_io_reorder_wmb()		wmb()
 #else
-#define war_io_reorder_wmb()		do { } while (0)
+#define war_io_reorder_wmb()		barrier()
 #endif
 
 #define __BUILD_MEMORY_SINGLE(pfx, bwlq, type, irq)			\
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2018-04-13 16:36 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-03 12:55 [PATCH v3 1/2] MIPS: io: prevent compiler reordering on the default writeX() implementation Sinan Kaya
2018-04-03 12:55 ` Sinan Kaya
2018-04-03 12:55 ` [PATCH v3 2/2] MIPS: io: add a barrier after register read in readX() Sinan Kaya
2018-04-03 12:55   ` Sinan Kaya
2018-04-06  1:34   ` Sinan Kaya
2018-04-06  1:34     ` Sinan Kaya
2018-04-06 18:15     ` Sinan Kaya
2018-04-06 18:15       ` Sinan Kaya
2018-04-06 21:26       ` James Hogan
2018-04-06 21:26         ` James Hogan
2018-04-07 21:43         ` Sinan Kaya
2018-04-07 21:43           ` Sinan Kaya
2018-04-11 17:10           ` Sinan Kaya
2018-04-11 17:10             ` Sinan Kaya
2018-04-11 20:26             ` James Hogan
2018-04-11 20:26               ` James Hogan
2018-04-11 20:26               ` James Hogan
2018-04-11 20:26               ` James Hogan
2018-04-11 20:48               ` Sinan Kaya
2018-04-11 20:48                 ` Sinan Kaya
2018-04-11 17:04         ` Maciej W. Rozycki
2018-04-11 17:04           ` Maciej W. Rozycki
2018-04-11 17:04           ` Maciej W. Rozycki
2018-04-11 17:04           ` Maciej W. Rozycki
2018-04-12 21:51   ` James Hogan
2018-04-12 21:51     ` James Hogan
2018-04-12 21:51     ` James Hogan
2018-04-12 21:58     ` James Hogan
2018-04-12 21:58       ` James Hogan
2018-04-12 22:38       ` Sinan Kaya
2018-04-12 22:38         ` Sinan Kaya
2018-04-12 22:20     ` Sinan Kaya
2018-04-12 22:20       ` Sinan Kaya
2018-04-13 15:41     ` David Laight
2018-04-13 15:41       ` David Laight
2018-04-13 15:41       ` David Laight
2018-04-13 16:36       ` Sinan Kaya
2018-04-13 16:36         ` Sinan Kaya
2018-04-13 16:36         ` Sinan Kaya
2018-04-13 16:36         ` Sinan Kaya

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.