summaryrefslogtreecommitdiffstats
path: root/arch/parisc/include/asm/irqflags.h
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2023-05-26 08:33:02 +0200
committerHelge Deller <deller@gmx.de>2023-06-30 17:14:13 +0200
commit40c9c62c85a8b7e58350f2d00649f9e0060150b7 (patch)
tree824246c41789aa4cbfcfb2bfb75b6104aadd51c0 /arch/parisc/include/asm/irqflags.h
parentparisc: Move TLB_PTLOCK option to Kconfig.debug (diff)
downloadlinux-40c9c62c85a8b7e58350f2d00649f9e0060150b7.tar.xz
linux-40c9c62c85a8b7e58350f2d00649f9e0060150b7.zip
parisc: Check if IRQs are disabled when calling arch_local_irq_restore()
A trivial check to check if IRQs are on although they should be off. Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch/parisc/include/asm/irqflags.h')
-rw-r--r--arch/parisc/include/asm/irqflags.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/parisc/include/asm/irqflags.h b/arch/parisc/include/asm/irqflags.h
index 38a19c0bac3a..00fd87724588 100644
--- a/arch/parisc/include/asm/irqflags.h
+++ b/arch/parisc/include/asm/irqflags.h
@@ -31,6 +31,11 @@ static inline unsigned long arch_local_irq_save(void)
static inline void arch_local_irq_restore(unsigned long flags)
{
+ /* warn if IRQs are on although they should be off */
+ if (IS_ENABLED(CONFIG_LIGHTWEIGHT_SPINLOCK_CHECK))
+ if (arch_local_save_flags() & PSW_I)
+ asm volatile("break 6,6\n"); /* SPINLOCK_BREAK_INSN */
+
asm volatile("mtsm %0" : : "r" (flags) : "memory");
}