linux/drivers/irqchip
Guo Ren af73b240e0 irqchip/sifive-plic: Fixup EOI failed when masked
commit 69ea463021be0d159ab30f96195fb0dd18ee2272 upstream.

When using "devm_request_threaded_irq(,,,,IRQF_ONESHOT,,)" in a driver,
only the first interrupt is handled, and following interrupts are never
delivered (initially reported in [1]).

That's because the RISC-V PLIC cannot EOI masked interrupts, as explained
in the description of Interrupt Completion in the PLIC spec [2]:

<quote>
The PLIC signals it has completed executing an interrupt handler by
writing the interrupt ID it received from the claim to the claim/complete
register. The PLIC does not check whether the completion ID is the same
as the last claim ID for that target. If the completion ID does not match
an interrupt source that *is currently enabled* for the target, the
completion is silently ignored.
</quote>

Re-enable the interrupt before completion if it has been masked during
the handling, and remask it afterwards.

[1] http://lists.infradead.org/pipermail/linux-riscv/2021-July/007441.html
[2] 8bc15a35d0/riscv-plic.adoc

Fixes: bb0fed1c60 ("irqchip/sifive-plic: Switch to fasteoi flow")
Reported-by: Vincent Pelletier <plr.vincent@gmail.com>
Tested-by: Nikita Shubin <nikita.shubin@maquefel.me>
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Cc: stable@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Atish Patra <atish.patra@wdc.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
[maz: amended commit message]
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211105094748.3894453-1-guoren@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-11-17 09:48:49 +01:00
..
Kconfig irqchip/goldfish-pic: Select GENERIC_IRQ_CHIP to fix build 2021-09-30 10:09:24 +02:00
Makefile irqchip: Add irq-ingenic-tcu driver 2019-08-08 15:30:07 -07:00
alphascale_asm9260-icoll.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
exynos-combiner.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
irq-al-fic.c irqchip/al-fic: Add support for irq retrigger 2019-09-09 18:11:47 +01:00
irq-alpine-msi.c irqchip/alpine-msi: Fix freeing of interrupts on allocation error path 2020-12-30 11:51:25 +01:00
irq-armada-370-xp.c
irq-aspeed-i2c-ic.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
irq-aspeed-vic.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
irq-ath79-cpu.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
irq-ath79-misc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
irq-ativic32.c nds32: Power management for nds32 2018-11-06 18:01:41 +08:00
irq-atmel-aic-common.c
irq-atmel-aic-common.h
irq-atmel-aic.c
irq-atmel-aic5.c irqchip/atmel-aic5: Add support for sam9x60 irqchip 2019-09-09 18:11:51 +01:00
irq-bcm2835.c irqchip: bcm283x: Switch to SPDX identifier 2018-12-13 09:35:36 +00:00
irq-bcm2836.c irqchip: bcm283x: Switch to SPDX identifier 2018-12-13 09:35:36 +00:00
irq-bcm6345-l1.c irq: mips: avoid nested irq_enter() 2021-11-17 09:48:39 +01:00
irq-bcm7038-l1.c irqchip/irq-bcm7038-l1: Enable parent IRQ if necessary 2020-01-04 19:17:21 +01:00
irq-bcm7120-l2.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
irq-brcmstb-l2.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
irq-clps711x.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
irq-crossbar.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
irq-csky-apb-intc.c irqchip/csky: fixup handle_irq_perbit break irq 2019-01-09 00:18:46 +08:00
irq-csky-mpintc.c Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-07-08 11:01:13 -07:00
irq-davinci-aintc.c irqchip: davinci-aintc: move the driver to drivers/irqchip 2019-02-19 20:02:17 +05:30
irq-davinci-cp-intc.c irqchip: davinci-cp-intc: move the driver to drivers/irqchip 2019-02-19 20:03:42 +05:30
irq-digicolor.c
irq-dw-apb-ictl.c genirq: Fix various typos in comments 2018-12-18 14:22:28 +01:00
irq-eznps.c
irq-ftintc010.c
irq-gic-common.c irqchip/gic: Skip DT quirks when evaluating IIDR-based quirks 2019-08-20 10:23:35 +01:00
irq-gic-common.h irqchip/gic: Prepare for more than 16 PPIs 2019-08-20 10:23:34 +01:00
irq-gic-pm.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
irq-gic-realview.c
irq-gic-v2m.c irqchip/gic-v2m: Register the frame's PA instead of its VA in fwnode 2019-08-07 14:24:37 +01:00
irq-gic-v3-its-fsl-mc-msi.c irqchip/gic-v3-its: Move minimum LPI requirements to individual busses 2018-07-16 14:22:19 +01:00
irq-gic-v3-its-pci-msi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
irq-gic-v3-its-platform-msi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
irq-gic-v3-its.c irqchip/gic-v3-its: Fix potential VPE leak on error 2021-09-30 10:09:24 +02:00
irq-gic-v3-mbi.c irqchip/gic-v3: Fix OF_BAD_ADDR error handling 2021-05-14 09:44:20 +02:00
irq-gic-v3.c irqchip/gic-v3: Do not enable irqs when handling spurious interrups 2021-05-11 14:04:04 +02:00
irq-gic-v4.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
irq-gic.c irqchip/gic: Atomically update affinity 2020-07-09 09:37:56 +02:00
irq-goldfish-pic.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
irq-hip04.c irqchip/gic: Prepare for more than 16 PPIs 2019-08-20 10:23:34 +01:00
irq-i8259.c irqchip/i8259: Fix shutdown order by moving syscore_ops registration 2019-02-14 10:42:11 +00:00
irq-imgpdc.c irqchip: Remove dev_err() usage after platform_get_irq() 2019-08-20 10:35:55 +01:00
irq-imx-gpcv2.c irqchip fixes for 5.3 2019-08-01 20:21:00 +02:00
irq-imx-irqsteer.c irqchip/imx-irqsteer: Use devm_platform_ioremap_resource() to simplify code 2019-04-29 15:45:00 +01:00
irq-ingenic-tcu.c irqchip/ingenic: Add support for the JZ4760 2021-03-30 14:35:22 +02:00
irq-ingenic.c irqchip/ingenic: Add support for the JZ4760 2021-03-30 14:35:22 +02:00
irq-ixp4xx.c irqchip/ixp4xx: Register the base PA instead of its VA in fwnode 2019-08-07 14:24:41 +01:00
irq-jcore-aic.c
irq-keystone.c irqchip: Remove dev_err() usage after platform_get_irq() 2019-08-20 10:35:55 +01:00
irq-lpc32xx.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 159 2019-05-30 11:26:37 -07:00
irq-ls-scfg-msi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
irq-ls1x.c irqchip/irq-ls1x: Missing error code in ls1x_intc_of_init() 2019-04-05 14:37:56 +02:00
irq-madera.c irqchip/madera: Drop GPIO includes 2019-01-17 17:04:24 +00:00
irq-mbigen.c irqchip/mbigen: Free msi_desc on device teardown 2020-04-23 10:36:20 +02:00
irq-meson-gpio.c irqchip/meson-gpio: Add support for meson sm1 SoCs 2019-08-30 15:01:06 +01:00
irq-mips-cpu.c irqchip/mips-cpu: Set IPI domain parent chip 2021-01-27 11:47:49 +01:00
irq-mips-gic.c irqchip/mips-gic: Use the correct local interrupt map registers 2019-06-05 09:35:31 +01:00
irq-mmp.c irqchip/mmp: Coexist with GIC root IRQ controller 2019-08-30 15:23:30 +01:00
irq-mscc-ocelot.c irqchhip: Convert to using %pOFn instead of device_node.name 2018-12-13 09:35:56 +00:00
irq-mtk-cirq.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
irq-mtk-sysirq.c irqchip/irq-mtk-sysirq: Replace spinlock with raw_spinlock 2020-08-19 08:16:02 +02:00
irq-mvebu-gicp.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
irq-mvebu-icu.c irqchip/irq-mvebu-icu: Add support for System Error Interrupts (SEI) 2018-10-02 12:00:30 +01:00
irq-mvebu-odmi.c
irq-mvebu-pic.c
irq-mvebu-sei.c irqchip/irq-mvebu-sei: Make mvebu_sei_ap806_caps static 2019-03-21 16:43:00 +01:00
irq-mxs.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 1 2019-05-21 11:28:39 +02:00
irq-nvic.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
irq-omap-intc.c
irq-ompic.c irqchip/ompic: fix return value check in ompic_of_init() 2018-01-04 11:13:22 +00:00
irq-or1k-pic.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
irq-orion.c irqchip: Convert to using %pOFn instead of device_node.name 2018-11-27 10:54:17 -06:00
irq-partition-percpu.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
irq-pic32-evic.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
irq-rda-intc.c irqchip/irq-rda-intc: Fix return value check in rda8810_intc_init() 2018-12-18 12:55:23 +00:00
irq-renesas-h8s.c genirq: Fix various typos in comments 2018-12-18 14:22:28 +01:00
irq-renesas-h8300h.c
irq-renesas-intc-irqpin.c irqchip/renesas-intc-irqpin: Use proper irq_chip name and parent 2019-06-11 12:22:42 +01:00
irq-renesas-irqc.c irqchip/renesas-irqc: Use proper irq_chip name and parent 2019-06-11 12:22:42 +01:00
irq-renesas-rza1.c irqchip/renesas-rza1: Fix an use-after-free in rza1_irqc_probe() 2019-07-26 14:40:01 +01:00
irq-s3c24xx.c ARM: s3c: irq-s3c24xx: Fix return value check for s3c24xx_init_intc() 2021-11-17 09:48:41 +01:00
irq-sa11x0.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
irq-sifive-plic.c irqchip/sifive-plic: Fixup EOI failed when masked 2021-11-17 09:48:49 +01:00
irq-sirfsoc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 4 2019-05-21 11:28:40 +02:00
irq-sni-exiu.c irqchip/exiu: Fix the index of fwspec for IRQ type 2020-12-02 08:49:55 +01:00
irq-st.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
irq-stm32-exti.c irqchip/stm32-exti: Avoid losing interrupts due to clearing pending bits by mistake 2020-09-03 11:27:06 +02:00
irq-sun4i.c irqchip/sun4i: Add support for Allwinner ARMv5 F1C100s 2018-12-13 09:35:58 +00:00
irq-sunxi-nmi.c
irq-tango.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
irq-tb10x.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 333 2019-06-05 17:37:06 +02:00
irq-tegra.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
irq-ti-sci-inta.c irqchip/ti-sci-inta: Fix return value about devm_ioremap_resource() 2020-08-19 08:15:58 +02:00
irq-ti-sci-intr.c irqchip/ti-sci-intr: Add support for Interrupt Router driver 2019-05-01 10:48:56 +01:00
irq-ts4800.c
irq-uniphier-aidet.c irqchip/uniphier-aidet: Use devm_platform_ioremap_resource() 2019-09-05 09:28:13 +01:00
irq-versatile-fpga.c irqchip/versatile-fpga: Apply clear-mask earlier 2020-04-17 10:50:11 +02:00
irq-vf610-mscm-ir.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
irq-vic.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
irq-vt8500.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
irq-xilinx-intc.c
irq-xtensa-mx.c drivers/irqchip: xtensa-mx: fix mask and unmask 2019-01-26 02:02:15 -08:00
irq-xtensa-pic.c drivers/irqchip: xtensa: add warning to irq_retrigger 2019-01-26 02:02:14 -08:00
irq-zevio.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
irqchip.c
qcom-irq-combiner.c irqchip: Remove dev_err() usage after platform_get_irq() 2019-08-20 10:35:55 +01:00
qcom-pdc.c irqchip/pdc: Setup all edge interrupts as rising edge at GIC 2018-10-02 10:37:38 +01:00
spear-shirq.c