linux-stable/drivers/irqchip
Paul Burton e875bd66df irqchip/mips-gic: Fix local interrupts
Since the device hierarchy domain was added by commit c98c1822ee
("irqchip/mips-gic: Add device hierarchy domain"), GIC local interrupts
have been broken.

Users attempting to setup a per-cpu local IRQ, for example the GIC timer
clock events code in drivers/clocksource/mips-gic-timer.c, the
setup_percpu_irq function would refuse with -EINVAL because the GIC
irqchip driver never called irq_set_percpu_devid so the
IRQ_PER_CPU_DEVID flag was never set for the IRQ. This happens because
irq_set_percpu_devid was being called from the gic_irq_domain_map
function which is no longer called.

Doing only that runs into further problems because gic_dev_domain_alloc
set the struct irq_chip for all interrupts, local or shared, to
gic_level_irq_controller despite that only being suitable for shared
interrupts. The typical outcome of this is that gic_level_irq_controller
callback functions are called for local interrupts, and then hwirq
number calculations overflow & the driver ends up attempting to access
some invalid register with an address calculated from an invalid hwirq
number. Best case scenario is that this then leads to a bus error. This
is fixed by abstracting the setup of the hwirq & chip to a new function
gic_setup_dev_chip which is used by both the root GIC IRQ domain & the
device domain.

Finally, decoding local interrupts failed because gic_dev_domain_alloc
only called irq_domain_alloc_irqs_parent for shared interrupts. Local
ones were therefore never associated with hwirqs in the root GIC IRQ
domain and the virq in gic_handle_local_int would always be 0. This is
fixed by calling irq_domain_alloc_irqs_parent unconditionally & having
gic_irq_domain_alloc handle both local & shared interrupts, which is
easy due to the aforementioned abstraction of chip setup into
gic_setup_dev_chip.

This fixes use of the MIPS GIC timer for clock events, which has been
broken since c98c1822ee ("irqchip/mips-gic: Add device hierarchy
domain") but hadn't been noticed due to a silent fallback to the MIPS
coprocessor 0 count/compare clock events device.

Fixes: c98c1822ee ("irqchip/mips-gic: Add device hierarchy domain")
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Qais Yousef <qsyousef@gmail.com>
Cc: stable@vger.kernel.org
Cc: Marc Zyngier <marc.zyngier@arm.com>
Link: http://lkml.kernel.org/r/20160913165335.31389-1-paul.burton@imgtec.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2016-09-20 23:20:02 +02:00
..
alphascale_asm9260-icoll.h
exynos-combiner.c irqchip/exynos-combiner: Fix usage of __raw IO 2016-06-23 18:26:42 +00:00
irq-alpine-msi.c
irq-armada-370-xp.c Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-07-29 13:55:30 -07:00
irq-aspeed-vic.c irqchip/aspeed-vic: Add irq controller for Aspeed 2016-06-22 18:44:54 +00:00
irq-ath79-cpu.c
irq-ath79-misc.c
irq-atmel-aic-common.c
irq-atmel-aic-common.h
irq-atmel-aic.c irqchip/atmel-aic: Fix potential deadlock in ->xlate() 2016-09-13 16:57:40 +02:00
irq-atmel-aic5.c irqchip/atmel-aic: Fix potential deadlock in ->xlate() 2016-09-13 16:57:40 +02:00
irq-bcm2835.c irqchip: bcm2835: Avoid arch/arm-specific handle_IRQ 2016-06-04 14:16:59 +00:00
irq-bcm2836.c Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-07-29 13:55:30 -07:00
irq-bcm6345-l1.c
irq-bcm7038-l1.c
irq-bcm7120-l2.c irqchip/bcm7120-l2: Make probe functions static 2016-06-13 00:56:31 +00:00
irq-brcmstb-l2.c irqchip/brcmstb-l2: Make of probe function static 2016-06-13 00:56:51 +00: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
irq-digicolor.c
irq-dw-apb-ictl.c
irq-eznps.c
irq-gic-common.c irqchip/gic: Prepare for adding platform driver 2016-06-13 11:53:52 +01:00
irq-gic-common.h
irq-gic-pm.c irqchip/gic: Add platform driver for non-root GICs that require RPM 2016-06-13 11:53:52 +01:00
irq-gic-realview.c
irq-gic-v2m.c irqchip/gic-v2m: Fix missing include of <linux/irqchip/arm-gic.h> 2016-06-13 00:57:09 +00:00
irq-gic-v3-its-pci-msi.c
irq-gic-v3-its-platform-msi.c
irq-gic-v3-its.c irqchip/gicv3-its: Disable the ITS before initializing it 2016-08-19 09:47:07 +01:00
irq-gic-v3.c irqchip/gicv3: Silence noisy DEBUG_PER_CPU_MAPS warning 2016-09-20 01:43:23 +02:00
irq-gic.c irqchip/gic: Allow self-SGIs for SMP on UP configurations 2016-08-17 18:31:20 +01:00
irq-hip04.c irqchip/hip04: Convert to hotplug state machine 2016-07-14 09:34:29 +02:00
irq-i8259.c
irq-imgpdc.c
irq-imx-gpcv2.c
irq-ingenic.c
irq-keystone.c
irq-lpc32xx.c
irq-ls-scfg-msi.c
irq-mbigen.c
irq-metag-ext.c
irq-metag.c
irq-mips-cpu.c
irq-mips-gic.c irqchip/mips-gic: Fix local interrupts 2016-09-20 23:20:02 +02:00
irq-mmp.c
irq-moxart.c
irq-mtk-sysirq.c
irq-mvebu-odmi.c
irq-mxs.c
irq-nvic.c
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
irq-orion.c
irq-partition-percpu.c
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
irq-renesas-h8300h.c
irq-renesas-intc-irqpin.c
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
irq-sun4i.c
irq-sunxi-nmi.c
irq-tango.c
irq-tb10x.c
irq-tegra.c irqchip/tegra: Fix sparse warnings on __iomem 2016-06-13 00:49:39 +00:00
irq-ts4800.c
irq-versatile-fpga.c
irq-vf610-mscm-ir.c
irq-vic.c irqchip/vic: Make vic_syscore_ops and vic_of_init static 2016-06-13 00:57:41 +00:00
irq-vt8500.c
irq-xtensa-mx.c
irq-xtensa-pic.c
irq-zevio.c
irqchip.c
Kconfig PCI changes for the v4.8 merge window: 2016-08-02 17:12:29 -04:00
Makefile irqchip core changes for v4.8 (second set) 2016-07-02 11:42:56 +02:00
spear-shirq.c remove lots of IS_ERR_VALUE abuses 2016-05-27 15:26:11 -07:00