diff options
author | Chris Metcalf <cmetcalf@tilera.com> | 2013-04-09 18:33:07 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-09 19:08:14 +0200 |
commit | 3e2e0d2c222bdf5bafd722dec1618fa6073ef372 (patch) | |
tree | 04ea03bb23d59080ce52012095591874cad6cf49 /arch/tile | |
parent | Merge tag 'hwspinlock-3.9-fix' of git://git.kernel.org/pub/scm/linux/kernel/g... (diff) | |
download | linux-3e2e0d2c222bdf5bafd722dec1618fa6073ef372.tar.xz linux-3e2e0d2c222bdf5bafd722dec1618fa6073ef372.zip |
tile: comment assumption about __insn_mtspr for <asm/irqflags.h>
The arch_local_irq_save(), etc., routines are required to function
as compiler barriers. They do, but it's subtle and requires knowing
that the gcc builtin __insn_mtspr() is marked as a memory clobber.
Provide a comment explaining the assumption.
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
[ This came about from me wondering about the synchronization rules of
__insn_mtspr() - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/tile')
-rw-r--r-- | arch/tile/include/asm/irqflags.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/tile/include/asm/irqflags.h b/arch/tile/include/asm/irqflags.h index 241c0bb60b12..c96f9bbb760d 100644 --- a/arch/tile/include/asm/irqflags.h +++ b/arch/tile/include/asm/irqflags.h @@ -40,7 +40,15 @@ #include <asm/percpu.h> #include <arch/spr_def.h> -/* Set and clear kernel interrupt masks. */ +/* + * Set and clear kernel interrupt masks. + * + * NOTE: __insn_mtspr() is a compiler builtin marked as a memory + * clobber. We rely on it being equivalent to a compiler barrier in + * this code since arch_local_irq_save() and friends must act as + * compiler barriers. This compiler semantic is baked into enough + * places that the compiler will maintain it going forward. + */ #if CHIP_HAS_SPLIT_INTR_MASK() #if INT_PERF_COUNT < 32 || INT_AUX_PERF_COUNT < 32 || INT_MEM_ERROR >= 32 # error Fix assumptions about which word various interrupts are in |