linux-stable/drivers/irqchip
Guo Ren 69ea463021 irqchip/sifive-plic: Fixup EOI failed when masked
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
2021-11-12 16:09:51 +00:00
..
Kconfig Merge branch irq/mchp-eic into irq/irqchip-next 2021-10-25 09:04:24 +01:00
Makefile irqchip/mchp-eic: Add support for the Microchip EIC 2021-10-20 19:40:54 +01: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 Merge branch irq/generic_handle_domain_irq-core into irq/irqchip-next 2021-06-11 14:32:12 +01:00
irq-al-fic.c irqchip: Bulk conversion to generic_handle_domain_irq() 2021-06-10 13:09:19 +01:00
irq-alpine-msi.c irqchip/alpine-msi: Switch to bitmap_zalloc() 2021-07-26 18:01:44 +01:00
irq-apple-aic.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-armada-370-xp.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-aspeed-i2c-ic.c irqchip: Bulk conversion to generic_handle_domain_irq() 2021-06-10 13:09:19 +01:00
irq-aspeed-scu-ic.c irqchip: Bulk conversion to generic_handle_domain_irq() 2021-06-10 13:09:19 +01:00
irq-aspeed-vic.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01: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 irqchip: Bulk conversion to generic_handle_domain_irq() 2021-06-10 13:09:19 +01:00
irq-ativic32.c irq: nds32: avoid CONFIG_HANDLE_DOMAIN_IRQ 2021-10-25 10:05:29 +01:00
irq-atmel-aic-common.c
irq-atmel-aic-common.h
irq-atmel-aic.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-atmel-aic5.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-bcm2835.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-bcm2836.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-bcm6345-l1.c irq: mips: simplify bcm6345_l1_irq_handle() 2021-10-25 10:04:53 +01:00
irq-bcm7038-l1.c irqchip/irq-bcm7038-l1: Switch to IRQCHIP_PLATFORM_DRIVER 2021-10-20 20:06:33 +01:00
irq-bcm7120-l2.c irqchip/irq-bcm7120-l2: Switch to IRQCHIP_PLATFORM_DRIVER 2021-10-20 20:06:34 +01:00
irq-brcmstb-l2.c irqchip/irq-brcmstb-l2: Switch to IRQCHIP_PLATFORM_DRIVER 2021-10-20 20:06:33 +01:00
irq-clps711x.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01: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 irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-csky-mpintc.c irqchip/csky-mpintc: Fixup mask/unmask implementation 2021-11-12 16:09:50 +00:00
irq-davinci-aintc.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-davinci-cp-intc.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-digicolor.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-dw-apb-ictl.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-ftintc010.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-gic-common.c irqchip/gic: Split vGIC probing information from the GIC code 2021-06-01 10:45:58 +01:00
irq-gic-common.h irqchip/gic: Split vGIC probing information from the GIC code 2021-06-01 10:45:58 +01:00
irq-gic-pm.c irqchip: gic-pm: Remove redundant error log of clock bulk 2021-06-11 14:21:04 +01:00
irq-gic-realview.c
irq-gic-v2m.c irqchip/gic-v2m: Switch to bitmap_zalloc() 2021-07-26 18:01:44 +01:00
irq-gic-v3-its-fsl-mc-msi.c bus: fsl-mc: Add ACPI support for fsl-mc 2020-07-28 15:51:32 +01:00
irq-gic-v3-its-pci-msi.c irqchip/gic-v3-its: Flag device allocation as proxied if behind a PCI bridge 2020-12-11 14:47:50 +00: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-22 14:37:04 +01:00
irq-gic-v3-mbi.c irqchip/gic-v3: Switch to bitmap_zalloc() 2021-07-26 18:04:01 +01:00
irq-gic-v3.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-gic-v4.c irqchip/gic-v4.1: Disable vSGI upon (GIC CPUIF < v4.1) detection 2021-04-22 15:55:21 +01:00
irq-gic.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-goldfish-pic.c irqchip: Bulk conversion to generic_handle_domain_irq() 2021-06-10 13:09:19 +01:00
irq-hip04.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-i8259.c irqchip: Bulk conversion to generic_handle_domain_irq() 2021-06-10 13:09:19 +01:00
irq-idt3243x.c irqchip: Bulk conversion to generic_handle_domain_irq() 2021-06-10 13:09:19 +01:00
irq-imgpdc.c Merge branch irq/generic_handle_domain_irq-core into irq/irqchip-next 2021-06-11 14:32:12 +01:00
irq-imx-gpcv2.c irqchip/irq-imx-gpcv2: Remove unnecessary oom message 2021-06-11 14:19:47 +01:00
irq-imx-intmux.c irqchip: Bulk conversion to generic_handle_domain_irq() 2021-06-10 13:09:19 +01:00
irq-imx-irqsteer.c irqchip: Bulk conversion to generic_handle_domain_irq() 2021-06-10 13:09:19 +01:00
irq-ingenic-tcu.c irqchip: Bulk conversion to generic_handle_domain_irq() 2021-06-10 13:09:19 +01:00
irq-ingenic.c irqchip: Bulk conversion to generic_handle_domain_irq() 2021-06-10 13:09:19 +01:00
irq-ixp4xx.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-jcore-aic.c irqchip/jcore-aic: Kill use of irq_create_strict_mappings() 2021-04-22 15:55:22 +01:00
irq-keystone.c irqchip: Bulk conversion to generic_handle_domain_irq() 2021-06-10 13:09:19 +01:00
irq-loongson-htpic.c irqchip: Bulk conversion to generic_handle_domain_irq() 2021-06-10 13:09:19 +01:00
irq-loongson-htvec.c irqchip: Bulk conversion to generic_handle_domain_irq() 2021-06-10 13:09:19 +01:00
irq-loongson-liointc.c irqchip: Bulk conversion to generic_handle_domain_irq() 2021-06-10 13:09:19 +01:00
irq-loongson-pch-msi.c irqchip/loongson-pch-msi: Use bitmap_zalloc() to allocate bitmap 2021-02-09 10:41:40 +00:00
irq-loongson-pch-pic.c irqchip/loongson-pch-pic: Improve edge triggered interrupt support 2021-08-12 07:57:23 +01:00
irq-lpc32xx.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-ls-extirq.c irqchip/ls-extirq: add IRQCHIP_SKIP_SET_WAKE to the irqchip flags 2021-01-29 11:06:38 +00:00
irq-ls-scfg-msi.c irqchip/ls-scfg-msi: Switch to devm_bitmap_zalloc() 2021-07-26 18:04:10 +01:00
irq-ls1x.c irqchip: Bulk conversion to generic_handle_domain_irq() 2021-06-10 13:09:19 +01:00
irq-madera.c irqchip/madera: Drop GPIO includes 2019-01-17 17:04:24 +00:00
irq-mbigen.c irqchip/mbigen: Repair non-kernel-doc notation 2021-09-22 14:32:26 +01:00
irq-mchp-eic.c irqchip/mchp-eic: Fix return value check in mchp_eic_init() 2021-10-25 09:02:18 +01:00
irq-meson-gpio.c irqchip/meson-gpio: Make it possible to build as a module 2021-10-20 19:38:01 +01:00
irq-mips-cpu.c irqchip/mips: Fix RCU violation when using irqdomain lookup on interrupt entry 2021-07-09 10:18:58 +01:00
irq-mips-gic.c irqchip/mips-gic: Get rid of the reliance on irq_cpu_online() 2021-10-26 11:19:38 +01:00
irq-mmp.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-mscc-ocelot.c irqchip: Bulk conversion to generic_handle_domain_irq() 2021-06-10 13:09:19 +01:00
irq-mst-intc.c irqchip/irq-mst: Support polarity configuration 2021-04-07 13:26:00 +01:00
irq-mtk-cirq.c irq: Fix typos in comments 2021-03-22 04:23:14 +01:00
irq-mtk-sysirq.c irqchip/mtk-sysirq: Skip setting irq-wake 2021-08-12 08:15:15 +01:00
irq-mvebu-gicp.c irqchip/mvebu-gicp: Switch to devm_bitmap_zalloc() 2021-07-26 18:04:10 +01:00
irq-mvebu-icu.c irqchip/irq-mvebu-icu: Make use of the helper function devm_platform_ioremap_resource() 2021-10-19 11:22:34 +01:00
irq-mvebu-odmi.c irqchip/mvebu-odmi: Switch to bitmap_zalloc() 2021-07-26 18:04:11 +01:00
irq-mvebu-pic.c irqchip/irq-mvebu-pic: Make use of the helper function devm_platform_ioremap_resource() 2021-10-19 11:22:59 +01:00
irq-mvebu-sei.c irqchip: Bulk conversion to generic_handle_domain_irq() 2021-06-10 13:09:19 +01:00
irq-mxs.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-nvic.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-omap-intc.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-ompic.c
irq-or1k-pic.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-orion.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-owl-sirq.c irqchip: Add Actions Semi Owl SIRQ controller 2020-09-25 16:57:33 +01:00
irq-partition-percpu.c irqchip/partitions: Switch to bitmap_zalloc() 2021-07-26 18:01:27 +01:00
irq-pic32-evic.c irqchip/mips: Fix RCU violation when using irqdomain lookup on interrupt entry 2021-07-09 10:18:58 +01:00
irq-pruss-intc.c irqchip: Bulk conversion to generic_handle_domain_irq() 2021-06-10 13:09:19 +01:00
irq-rda-intc.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-realtek-rtl.c irqchip: Bulk conversion to generic_handle_domain_irq() 2021-06-10 13:09:19 +01: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: Merge irlm_bit and needs_irlm 2020-11-01 11:59:22 +00:00
irq-renesas-irqc.c irqchip: Bulk conversion to generic_handle_domain_irq() 2021-06-10 13:09:19 +01:00
irq-renesas-rza1.c irqchip/renesas-rza1: Use semicolons instead of commas 2021-09-22 14:37:59 +01:00
irq-riscv-intc.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-sa11x0.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-sifive-plic.c irqchip/sifive-plic: Fixup EOI failed when masked 2021-11-12 16:09:51 +00:00
irq-sl28cpld.c irqchip/irq-sl28cpld: Convert comma to semicolon 2020-12-18 17:43:47 +00:00
irq-sni-exiu.c irqchip/exiu: Fix the index of fwspec for IRQ type 2020-11-22 10:27:23 +00: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: Make use of the helper function devm_platform_ioremap_resource() 2021-10-19 11:24:05 +01:00
irq-sun4i.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-sun6i-r.c irqchip/sun6i-r: Add wakeup support 2021-01-21 20:21:49 +00:00
irq-sunxi-nmi.c irqchip: Bulk conversion to generic_handle_domain_irq() 2021-06-10 13:09:19 +01:00
irq-tb10x.c irqchip: Bulk conversion to generic_handle_domain_irq() 2021-06-10 13:09:19 +01: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: Make use of the helper function devm_platform_ioremap_resource() 2021-10-19 11:24:28 +01:00
irq-ti-sci-intr.c irqchip/ti-sci-intr: Fix freeing of irqs 2020-12-11 14:47:50 +00:00
irq-ts4800.c irqchip/irq-ts4800: Make use of the helper function devm_platform_ioremap_resource() 2021-10-19 11:23:44 +01:00
irq-uniphier-aidet.c irqchip/uniphier-aidet: Use devm_platform_ioremap_resource() 2019-09-05 09:28:13 +01:00
irq-versatile-fpga.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01: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 irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-vt8500.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-wpcm450-aic.c irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irq-xilinx-intc.c irqchip: Bulk conversion to generic_handle_domain_irq() 2021-06-10 13:09:19 +01:00
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 irq: remove handle_domain_{irq,nmi}() 2021-10-26 10:13:31 +01:00
irqchip.c treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
qcom-irq-combiner.c irqchip: Bulk conversion to generic_handle_domain_irq() 2021-06-10 13:09:19 +01:00
qcom-pdc.c irqchip/qcom-pdc: Trim unused levels of the interrupt hierarchy 2021-08-23 09:45:31 +01:00
spear-shirq.c