Skip to content

Commit a3e6c1e

Browse files
Felix Fietkauralfbaechle
authored andcommitted
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>
1 parent c3f134f commit a3e6c1e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/mips/kernel/irq_cpu.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ static struct irq_chip mips_cpu_irq_controller = {
5757
.irq_mask_ack = mask_mips_irq,
5858
.irq_unmask = unmask_mips_irq,
5959
.irq_eoi = unmask_mips_irq,
60+
.irq_disable = mask_mips_irq,
61+
.irq_enable = unmask_mips_irq,
6062
};
6163

6264
/*
@@ -93,6 +95,8 @@ static struct irq_chip mips_mt_cpu_irq_controller = {
9395
.irq_mask_ack = mips_mt_cpu_irq_ack,
9496
.irq_unmask = unmask_mips_irq,
9597
.irq_eoi = unmask_mips_irq,
98+
.irq_disable = mask_mips_irq,
99+
.irq_enable = unmask_mips_irq,
96100
};
97101

98102
asmlinkage void __weak plat_irq_dispatch(void)

0 commit comments

Comments
 (0)