Commit d97299c9 authored by Marcus Shawcroft's avatar Marcus Shawcroft Committed by Kumar Gala
Browse files

arm: fix irq_unlock() ordering bug



Add the missing memory clobber to irq_unlock() in order to prevent the
compiler reordering memory operations over the unlock.

Change-Id: If1d664079796618ed247ff5b33b8b3f85fb7e680
Signed-off-by: default avatarMarcus Shawcroft <marcus.shawcroft@arm.com>
parent 6e2fbead
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -173,9 +173,9 @@ static ALWAYS_INLINE void _arch_irq_unlock(unsigned int key)
	if (key) {
		return;
	}
	__asm__ volatile("cpsie i;\n\t");
	__asm__ volatile("cpsie i;\n\t" : : : "memory");
#else /* CONFIG_CPU_CORTEX_M3_M4 */
	__asm__ volatile("msr BASEPRI, %0;\n\t" :  : "r"(key));
	__asm__ volatile("msr BASEPRI, %0;\n\t" :  : "r"(key) : "memory");
#endif
}