linux-stable/drivers/irqchip
Matt Redfearn 4a665d628f irqchip/mips-gic: Avoid spuriously handling masked interrupts
commit 285cb4f623 upstream.

Commit 7778c4b27c ("irqchip: mips-gic: Use pcpu_masks to avoid reading
GIC_SH_MASK*") removed the read of the hardware mask register when
handling shared interrupts, instead using the driver's shadow pcpu_masks
entry as the effective mask. Unfortunately this did not take account of
the write to pcpu_masks during gic_shared_irq_domain_map, which
effectively unmasks the interrupt early. If an interrupt is asserted,
gic_handle_shared_int decodes and processes the interrupt even though it
has not yet been unmasked via gic_unmask_irq, which also sets the
appropriate bit in pcpu_masks.

On the MIPS Boston board, when a console command line of
"console=ttyS0,115200n8r" is passed, the modem status IRQ is enabled in
the UART, which is immediately raised to the GIC. The interrupt has been
mapped, but no handler has yet been registered, nor is it expected to be
unmasked. However, the write to pcpu_masks in gic_shared_irq_domain_map
has effectively unmasked it, resulting in endless reports of:

[    5.058454] irq 13, desc: ffffffff80a7ad80, depth: 1, count: 0, unhandled: 0
[    5.062057] ->handle_irq():  ffffffff801b1838,
[    5.062175] handle_bad_irq+0x0/0x2c0

Where IRQ 13 is the UART interrupt.

To fix this, just remove the write to pcpu_masks in
gic_shared_irq_domain_map. The existing write in gic_unmask_irq is the
correct place for what is now the effective unmasking.

Cc: stable@vger.kernel.org
Fixes: 7778c4b27c ("irqchip: mips-gic: Use pcpu_masks to avoid reading GIC_SH_MASK*")
Signed-off-by: Matt Redfearn <matt.redfearn@mips.com>
Reviewed-by: Paul Burton <paul.burton@mips.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-28 10:19:41 +01:00
..
alphascale_asm9260-icoll.h irqchip/mxs: Add Alphascale ASM9260 support 2015-10-14 09:37:47 +02:00
exynos-combiner.c irqchip/exynos-combiner: Fix usage of __raw IO 2016-06-23 18:26:42 +00:00
irq-alpine-msi.c irqchip/irq-alpine-msi: Don't use <asm-generic/msi.h> 2016-05-11 10:12:25 +01:00
irq-armada-370-xp.c irqchip updates for 4.14 2017-08-31 20:12:51 +02:00
irq-aspeed-i2c-ic.c irqchip/aspeed-i2c-ic: Add I2C IRQ controller for Aspeed 2017-06-22 14:15:00 +01:00
irq-aspeed-vic.c irqchip/aspeed-vic: Add AST2500 compatible string 2017-06-22 14:13:39 +01:00
irq-ath79-cpu.c irqchip/ath79-cpu: Move the CPU IRQ driver from arch/mips/ath79/ 2016-02-17 13:47:19 +00:00
irq-ath79-misc.c irqchip/ath79-misc: Move the MISC driver from arch/mips/ath79/ 2016-02-17 13:44:31 +00:00
irq-atmel-aic-common.c irqchip/atmel-aic: Remove root argument from ->fixup() prototype 2017-07-04 11:10:37 +01:00
irq-atmel-aic-common.h irqchip/atmel-aic: Remove root argument from ->fixup() prototype 2017-07-04 11:10:37 +01:00
irq-atmel-aic.c irqchip/atmel-aic: Remove root argument from ->fixup() prototype 2017-07-04 11:10:37 +01:00
irq-atmel-aic5.c irqchip/atmel-aic: Remove root argument from ->fixup() prototype 2017-07-04 11:10:37 +01:00
irq-bcm2835.c irqchip: Convert to using %pOF instead of full_name 2017-08-23 10:09:28 +01:00
irq-bcm2836.c irqchip: Convert to using %pOF instead of full_name 2017-08-23 10:09:28 +01:00
irq-bcm6345-l1.c irqchip/bcm-6345-l1: Report that effective affinity is a single target 2017-08-18 10:54:41 +02:00
irq-bcm7038-l1.c irqchip/bcm-7038-l1: Report that effective affinity is a single target 2017-08-18 10:54:42 +02:00
irq-bcm7120-l2.c irqchip/irq-bcm7120-l2: Use correct I/O accessors for irq_fwd_mask 2017-08-31 15:32:18 +01:00
irq-brcmstb-l2.c irqchip: brcmstb-l2: Define an irq_pm_shutdown function 2017-08-07 13:50:52 +01:00
irq-clps711x.c irqchip: clps711x: Changing the compatibility string to match with the smallest supported chip 2016-07-06 17:38:15 +02:00
irq-crossbar.c irqchip: Convert to using %pOF instead of full_name 2017-08-23 10:09:28 +01:00
irq-digicolor.c irqchip: Convert to using %pOF instead of full_name 2017-08-23 10:09:28 +01:00
irq-dw-apb-ictl.c irqchip: Convert to using %pOF instead of full_name 2017-08-23 10:09:28 +01:00
irq-eznps.c irqchip/eznps: Drop pointless static qualifier in nps400_of_init() 2016-10-19 14:24:36 +02:00
irq-ftintc010.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
irq-gic-common.c irqchip/gic: Prepare for adding platform driver 2016-06-13 11:53:52 +01:00
irq-gic-common.h irqchip/gic-v2: Parse and export virtual GIC information 2016-05-03 12:54:21 +02:00
irq-gic-pm.c irqchip/gic-pm: Update driver to use of_pm_clk_add_clk 2016-09-12 19:46:28 +01:00
irq-gic-realview.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
irq-gic-v2m.c irqchip/MSI: Use irq_domain_update_bus_token instead of an open coded access 2017-06-22 18:29:17 +02:00
irq-gic-v3-its-pci-msi.c irqchip: Convert to using %pOF instead of full_name 2017-08-23 10:09:28 +01:00
irq-gic-v3-its-platform-msi.c irqchip/gic-v3-its-platform-msi: Fix msi-parent parsing loop 2017-08-10 16:26:54 +01:00
irq-gic-v3-its.c irqchip/gic-v3-its: Add missing changes to support 52bit physical address 2017-10-13 16:30:58 +01:00
irq-gic-v3.c irqchip/gic-v3: Use wmb() instead of smb_wmb() in gic_raise_softirq() 2018-02-28 10:19:41 +01:00
irq-gic-v4.c irqchip/gic-v4: Fix building with ancient gcc 2017-09-19 19:43:45 +01:00
irq-gic.c Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-09-04 13:08:27 -07:00
irq-hip04.c irqchip/hip04: Report that effective affinity is a single target 2017-08-18 10:54:42 +02:00
irq-i8259.c irqchip/i8259: Constify irq_domain_ops 2017-06-22 14:12:49 +01:00
irq-imgpdc.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
irq-imx-gpcv2.c irqchip: Convert to using %pOF instead of full_name 2017-08-23 10:09:28 +01:00
irq-ingenic.c
irq-jcore-aic.c irqchip/jcore: Fix lost per-cpu interrupts 2016-10-14 14:26:55 +02:00
irq-keystone.c irqchip/keystone: Fix "scheduling while atomic" on rt 2016-12-31 18:41:45 +00:00
irq-lpc32xx.c irqchip: Convert to using %pOF instead of full_name 2017-08-23 10:09:28 +01:00
irq-ls-scfg-msi.c irqchip/ls-scfg-msi: Add MSI affinity support 2017-08-31 16:19:48 +01:00
irq-mbigen.c irqchip/irq-mbigen: Constify irq_domain_ops 2017-06-22 14:13:00 +01:00
irq-metag-ext.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
irq-metag.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
irq-mips-cpu.c MIPS: Unify checks for sibling CPUs 2017-08-30 00:57:27 +02:00
irq-mips-gic.c irqchip/mips-gic: Avoid spuriously handling masked interrupts 2018-02-28 10:19:41 +01:00
irq-mmp.c irqchip/mmp: Make mmp_intc_conf const 2017-08-31 15:31:43 +01:00
irq-mtk-cirq.c irqchip: Add Mediatek mtk-cirq driver 2017-04-07 10:52:22 +01:00
irq-mtk-sysirq.c irqchip: Convert to using %pOF instead of full_name 2017-08-23 10:09:28 +01:00
irq-mvebu-gicp.c irqchip/irq-mvebu-gicp: Add missing spin_lock init 2017-11-01 00:35:18 +01:00
irq-mvebu-gicp.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
irq-mvebu-icu.c irqchip/irq-mvebu-icu: Add new driver for Marvell ICU 2017-06-23 09:14:57 +01:00
irq-mvebu-odmi.c irqchip/gic: Return IRQ_SET_MASK_OK_DONE in the set_affinity method 2016-02-19 15:42:29 +00:00
irq-mvebu-pic.c irqchip/mvebu-pic: New driver for Marvell Armada 7K/8K PIC 2016-08-22 22:58:27 +00:00
irq-mxs.c irqchip: Convert to using %pOF instead of full_name 2017-08-23 10:09:28 +01:00
irq-nvic.c irqchip: Convert all alloc/xlate users from of_node to fwnode 2015-10-13 19:01:23 +02:00
irq-omap-intc.c irqchip/omap-intc: Fix missing <linux/irqchip/irq-omap-intc.h> include 2016-06-13 00:57:23 +00:00
irq-or1k-pic.c irqchip/or1k-pic: Fix interrupt acknowledgement 2017-06-30 15:33:11 +01:00
irq-orion.c
irq-partition-percpu.c irqchip: Add per-cpu interrupt partitioning library 2016-05-02 13:42:51 +02:00
irq-pic32-evic.c irqchip/irq-pic32-evic: Fix bug with external interrupts. 2016-06-02 18:03:50 +01:00
irq-renesas-h8s.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
irq-renesas-h8300h.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
irq-renesas-intc-irqpin.c irqchip/renesas-intc-irqpin: Improve clock error handling and reporting 2015-11-24 16:54:19 +00:00
irq-renesas-irqc.c
irq-s3c24xx.c irqchip/s3c24xx: Fixup IO accessors for big endian 2016-06-23 18:28:00 +00:00
irq-sa11x0.c
irq-sirfsoc.c irqchip/sirfsoc: Fix sparse warnings on __iomem 2016-06-13 00:48:31 +00:00
irq-st.c irqchip/st: Mark st_irq_syscfg_resume() __maybe_unused 2016-12-19 10:55:43 +01:00
irq-stm32-exti.c irqchip: Convert to using %pOF instead of full_name 2017-08-23 10:09:28 +01:00
irq-sun4i.c irqchip: Convert to using %pOF instead of full_name 2017-08-23 10:09:28 +01:00
irq-sunxi-nmi.c irqchip/sunxi-nmi: Support sun6i-a31-r-intc compatible 2017-06-22 14:08:17 +01:00
irq-tango.c irqchip/tango: Use irq_gc_mask_disable_and_ack_set 2017-10-13 16:31:05 +01:00
irq-tb10x.c
irq-tegra.c irqchip: Convert to using %pOF instead of full_name 2017-08-23 10:09:28 +01:00
irq-ts4800.c irqchip/ts4800: Make ts4800_ic_ops static const 2016-02-18 02:09:18 +00:00
irq-uniphier-aidet.c irqchip: Add UniPhier AIDET irqchip driver 2017-08-23 10:08:44 +01:00
irq-versatile-fpga.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
irq-vf610-mscm-ir.c irqchip: Convert all alloc/xlate users from of_node to fwnode 2015-10-13 19:01:23 +02:00
irq-vic.c irqchip/vic: Improve function-level documentation 2016-10-05 11:53:35 +02:00
irq-vt8500.c
irq-xilinx-intc.c irqchip: Convert to using %pOF instead of full_name 2017-08-23 10:09:28 +01:00
irq-xtensa-mx.c irqchip/xtensa-mx: Report that effective affinity is a single target 2017-08-18 10:54:43 +02:00
irq-xtensa-pic.c xtensa: don't use linux IRQ #0 2017-06-05 16:53:10 -07:00
irq-zevio.c irqchip/zevio: Use irq_data_get_chip_type() helper 2015-12-30 18:29:02 +01:00
irqchip.c
Kconfig irqchip updates for 4.14 2017-08-31 20:12:51 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
qcom-irq-combiner.c irqchip/qcom: Fix u32 comparison with value less than zero 2017-12-14 09:53:05 +01:00
spear-shirq.c remove lots of IS_ERR_VALUE abuses 2016-05-27 15:26:11 -07:00