Commit d39e0a92 authored by Benjamin Walsh's avatar Benjamin Walsh Committed by Kumar Gala
Browse files

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 15bc5377 for the ARM fix for
a complete description of the issue and fix.

Change-Id: I056afb0406cabe0e1ce2612904e727ccce5f6308
Signed-off-by: default avatarBenjamin Walsh <benjamin.walsh@windriver.com>
parent c9235e28
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ static ALWAYS_INLINE unsigned int _arch_irq_lock(void)
{
	unsigned int key;

	__asm__ volatile("clri %0" : "=r"(key));
	__asm__ volatile("clri %0" : "=r"(key):: "memory");
	return key;
}

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

static ALWAYS_INLINE void _arch_irq_unlock(unsigned int key)
{
	__asm__ volatile("seti %0" : : "ir"(key));
	__asm__ volatile("seti %0" : : "ir"(key) : "memory");
}

#endif /* _ASMLANGUAGE */