Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1299360

[PATCH 08/34] asm-generic: smp_store_mb should use smp_mb

From "Michael S. Tsirkin" <mst@redhat.com>
Newsgroups linux.kernel
Subject [PATCH 08/34] asm-generic: smp_store_mb should use smp_mb
Date 2015-12-30 14:30 +0100
Message-ID <qLoZd-79S-33@gated-at.bofh.it> (permalink)
References <qLoZb-79S-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


asm-generic variant of smp_store_mb() calls mb() which is stronger
than implied by both the name and the documentation.

smp_store_mb is only used by core kernel code at the moment, so
we know no one mis-uses it for an MMIO barrier.
Make it call smp_mb consistently before some arch-specific
code uses it as such by mistake.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 include/asm-generic/barrier.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/asm-generic/barrier.h b/include/asm-generic/barrier.h
index 538f8d1..987b2e0 100644
--- a/include/asm-generic/barrier.h
+++ b/include/asm-generic/barrier.h
@@ -93,7 +93,7 @@
 #endif	/* CONFIG_SMP */
 
 #ifndef smp_store_mb
-#define smp_store_mb(var, value)  do { WRITE_ONCE(var, value); mb(); } while (0)
+#define smp_store_mb(var, value)  do { WRITE_ONCE(var, value); smp_mb(); } while (0)
 #endif
 
 #ifndef smp_mb__before_atomic
-- 
MST

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 08/34] asm-generic: smp_store_mb should use smp_mb "Michael S. Tsirkin" <mst@redhat.com> - 2015-12-30 14:30 +0100
  Re: [PATCH 08/34] asm-generic: smp_store_mb should use smp_mb Arnd Bergmann <arnd@arndb.de> - 2015-12-30 14:50 +0100
    Re: [PATCH 08/34] asm-generic: smp_store_mb should use smp_mb "Michael S. Tsirkin" <mst@redhat.com> - 2015-12-30 21:40 +0100
      Re: [PATCH 08/34] asm-generic: smp_store_mb should use smp_mb Arnd Bergmann <arnd@arndb.de> - 2015-12-30 23:50 +0100

csiph-web