Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: IRQ: Fix disable_irq on CPU IRQs

If the irq_chip does not define .irq_disable, any call to disable_irq
will defer disabling the IRQ until it fires while marked as disabled.
This assumes that the handler function checks for this condition, which
handle_percpu_irq does not. In this case, calling disable_irq leads to
an IRQ storm, if the interrupt fires while disabled.

This optimization is only useful when disabling the IRQ is slow, which
is not true for the MIPS CPU IRQ.

Disable this optimization by implementing .irq_disable and .irq_enable

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/8949/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Felix Fietkau and committed by
Ralf Baechle
a3e6c1ef c3f134fb

+4
+4
arch/mips/kernel/irq_cpu.c
··· 57 57 .irq_mask_ack = mask_mips_irq, 58 58 .irq_unmask = unmask_mips_irq, 59 59 .irq_eoi = unmask_mips_irq, 60 + .irq_disable = mask_mips_irq, 61 + .irq_enable = unmask_mips_irq, 60 62 }; 61 63 62 64 /* ··· 95 93 .irq_mask_ack = mips_mt_cpu_irq_ack, 96 94 .irq_unmask = unmask_mips_irq, 97 95 .irq_eoi = unmask_mips_irq, 96 + .irq_disable = mask_mips_irq, 97 + .irq_enable = unmask_mips_irq, 98 98 }; 99 99 100 100 asmlinkage void __weak plat_irq_dispatch(void)