]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
powerpc/irq: Don't WARN continuously in arch_local_irq_restore()
authorMichael Ellerman <mpe@ellerman.id.au>
Mon, 8 Jul 2019 06:02:19 +0000 (16:02 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jul 2019 05:24:51 +0000 (07:24 +0200)
[ Upstream commit 0fc12c022ad25532b66bf6f6c818ee1c1d63e702 ]

When CONFIG_PPC_IRQ_SOFT_MASK_DEBUG is enabled (uncommon), we have a
series of WARN_ON's in arch_local_irq_restore().

These are "should never happen" conditions, but if they do happen they
can flood the console and render the system unusable. So switch them
to WARN_ON_ONCE().

Fixes: e2b36d591720 ("powerpc/64: Don't trace code that runs with the soft irq mask unreconciled")
Fixes: 9b81c0211c24 ("powerpc/64s: make PACA_IRQ_HARD_DIS track MSR[EE] closely")
Fixes: 7c0482e3d055 ("powerpc/irq: Fix another case of lazy IRQ state getting out of sync")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190708061046.7075-1-mpe@ellerman.id.au
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/kernel/irq.c

index bc68c53af67c97c7cb10cf4e573d3c72fe00be98..5645bc9cbc09a28c1fbc324743e4d568c3033dc6 100644 (file)
@@ -255,7 +255,7 @@ notrace void arch_local_irq_restore(unsigned long mask)
        irq_happened = get_irq_happened();
        if (!irq_happened) {
 #ifdef CONFIG_PPC_IRQ_SOFT_MASK_DEBUG
-               WARN_ON(!(mfmsr() & MSR_EE));
+               WARN_ON_ONCE(!(mfmsr() & MSR_EE));
 #endif
                return;
        }
@@ -268,7 +268,7 @@ notrace void arch_local_irq_restore(unsigned long mask)
         */
        if (!(irq_happened & PACA_IRQ_HARD_DIS)) {
 #ifdef CONFIG_PPC_IRQ_SOFT_MASK_DEBUG
-               WARN_ON(!(mfmsr() & MSR_EE));
+               WARN_ON_ONCE(!(mfmsr() & MSR_EE));
 #endif
                __hard_irq_disable();
 #ifdef CONFIG_PPC_IRQ_SOFT_MASK_DEBUG
@@ -279,7 +279,7 @@ notrace void arch_local_irq_restore(unsigned long mask)
                 * warn if we are wrong. Only do that when IRQ tracing
                 * is enabled as mfmsr() can be costly.
                 */
-               if (WARN_ON(mfmsr() & MSR_EE))
+               if (WARN_ON_ONCE(mfmsr() & MSR_EE))
                        __hard_irq_disable();
 #endif
        }