Skip to content

Commit

Permalink
sh: define __smp_xxx, fix smp_store_mb for !SMP
Browse files Browse the repository at this point in the history
sh variant of smp_store_mb() calls xchg() on !SMP which is stronger than
implied by both the name and the documentation.

define __smp_store_mb instead: code in asm-generic/barrier.h
will then define smp_store_mb correctly depending on
CONFIG_SMP.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
  • Loading branch information
Michael S. Tsirkin committed Jan 12, 2016
1 parent 82b4449 commit 90a3ccb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/sh/include/asm/barrier.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
#define ctrl_barrier() __asm__ __volatile__ ("nop;nop;nop;nop;nop;nop;nop;nop")
#endif

#define smp_store_mb(var, value) do { (void)xchg(&var, value); } while (0)
#define __smp_store_mb(var, value) do { (void)xchg(&var, value); } while (0)
#define smp_store_mb(var, value) __smp_store_mb(var, value)

#include <asm-generic/barrier.h>

Expand Down

0 comments on commit 90a3ccb

Please sign in to comment.