Skip to content

Commit d39e0a9

Browse files
benwrsgalak
authored andcommitted
arc: fix irq_lock/unlock ordering bug
Memory accesses could be reordered before an irq_lock() or after an irq_unlock() without the memory barriers. See commit 15bc537 for the ARM fix for a complete description of the issue and fix. Change-Id: I056afb0406cabe0e1ce2612904e727ccce5f6308 Signed-off-by: Benjamin Walsh <[email protected]>
1 parent c9235e2 commit d39e0a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/arch/arc/v2/irq.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static ALWAYS_INLINE unsigned int _arch_irq_lock(void)
8181
{
8282
unsigned int key;
8383

84-
__asm__ volatile("clri %0" : "=r"(key));
84+
__asm__ volatile("clri %0" : "=r"(key):: "memory");
8585
return key;
8686
}
8787

@@ -100,7 +100,7 @@ static ALWAYS_INLINE unsigned int _arch_irq_lock(void)
100100

101101
static ALWAYS_INLINE void _arch_irq_unlock(unsigned int key)
102102
{
103-
__asm__ volatile("seti %0" : : "ir"(key));
103+
__asm__ volatile("seti %0" : : "ir"(key) : "memory");
104104
}
105105

106106
#endif /* _ASMLANGUAGE */

0 commit comments

Comments
 (0)