linux/drivers/irqchip
qiuguorui1 47c8387a96 irqchip/stm32-exti: Avoid losing interrupts due to clearing pending bits by mistake
commit e579076ac0 upstream.

In the current code, when the eoi callback of the exti clears the pending
bit of the current interrupt, it will first read the values of fpr and
rpr, then logically OR the corresponding bit of the interrupt number,
and finally write back to fpr and rpr.

We found through experiments that if two exti interrupts,
we call them int1/int2, arrive almost at the same time. in our scenario,
the time difference is 30 microseconds, assuming int1 is triggered first.

there will be an extreme scenario: both int's pending bit are set to 1,
the irq handle of int1 is executed first, and eoi handle is then executed,
at this moment, all pending bits are cleared, but the int 2 has not
finally been reported to the cpu yet, which eventually lost int2.

According to stm32's TRM description about rpr and fpr: Writing a 1 to this
bit will trigger a rising edge event on event x, Writing 0 has no
effect.

Therefore, when clearing the pending bit, we only need to clear the
pending bit of the irq.

Fixes: 927abfc446 ("irqchip/stm32: Add stm32mp1 support with hierarchy domain")
Signed-off-by: qiuguorui1 <qiuguorui1@huawei.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: stable@vger.kernel.org # v4.18+
Link: https://lore.kernel.org/r/20200820031629.15582-1-qiuguorui1@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-03 11:27:06 +02:00
..
Kconfig irqchip: Place CONFIG_SIFIVE_PLIC into the menu 2020-01-23 08:22:55 +01:00
Makefile irqchip: Add irq-ingenic-tcu driver 2019-08-08 15:30:07 -07:00
alphascale_asm9260-icoll.h
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
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
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
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
irq-bcm2836.c
irq-bcm6345-l1.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02: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
irq-clps711x.c
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-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
irq-davinci-cp-intc.c
irq-digicolor.c
irq-dw-apb-ictl.c
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
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 genirq/affinity: Make affinity setting if activated opt-in 2020-08-21 13:05:20 +02:00
irq-gic-v3-mbi.c
irq-gic-v3.c irqchip/gic-v3: Only provision redistributors that are enabled in ACPI 2020-02-24 08:36:59 +01: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
irq-hip04.c irqchip/gic: Prepare for more than 16 PPIs 2019-08-20 10:23:34 +01:00
irq-i8259.c
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
irq-ingenic-tcu.c irqchip: Add irq-ingenic-tcu driver 2019-08-08 15:30:07 -07:00
irq-ingenic.c irqchip: ingenic: Error out if IRQ domain creation failed 2020-01-04 19:17:22 +01: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
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
irq-madera.c
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
irq-mips-gic.c
irq-mmp.c irqchip/mmp: Coexist with GIC root IRQ controller 2019-08-30 15:23:30 +01:00
irq-mscc-ocelot.c
irq-mtk-cirq.c
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
irq-mvebu-icu.c
irq-mvebu-odmi.c
irq-mvebu-pic.c
irq-mvebu-sei.c
irq-mxs.c
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
irq-or1k-pic.c
irq-orion.c
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
irq-rda-intc.c
irq-renesas-h8s.c
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
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 updates for 5.4, take 2 2019-10-25 14:25:15 +02:00
irq-sirfsoc.c
irq-sni-exiu.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-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
irq-sunxi-nmi.c
irq-tango.c
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
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
irq-vt8500.c
irq-xilinx-intc.c
irq-xtensa-mx.c
irq-xtensa-pic.c
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
spear-shirq.c