linux/drivers/pci/host
Grygorii Strashko 16870da043 PCI: host: Mark PCIe/PCI (MSI) IRQ cascade handlers as IRQF_NO_THREAD
[ Upstream commit 8ff0ef996c ]

On -RT and if kernel is booting with "threadirqs" cmd line parameter,
PCIe/PCI (MSI) IRQ cascade handlers (like dra7xx_pcie_msi_irq_handler())
will be forced threaded and, as result, will generate warnings like this:

  WARNING: CPU: 1 PID: 82 at kernel/irq/handle.c:150 handle_irq_event_percpu+0x14c/0x174()
  irq 460 handler irq_default_primary_handler+0x0/0x14 enabled interrupts
  Backtrace:
   (warn_slowpath_common) from (warn_slowpath_fmt+0x38/0x40)
   (warn_slowpath_fmt) from (handle_irq_event_percpu+0x14c/0x174)
   (handle_irq_event_percpu) from (handle_irq_event+0x84/0xb8)
   (handle_irq_event) from (handle_simple_irq+0x90/0x118)
   (handle_simple_irq) from (generic_handle_irq+0x30/0x44)
   (generic_handle_irq) from (dra7xx_pcie_msi_irq_handler+0x7c/0x8c)
   (dra7xx_pcie_msi_irq_handler) from (irq_forced_thread_fn+0x28/0x5c)
   (irq_forced_thread_fn) from (irq_thread+0x128/0x204)

This happens because all of them invoke generic_handle_irq() from the
requested handler.  generic_handle_irq() grabs raw_locks and thus needs to
run in raw-IRQ context.

This issue was originally reproduced on TI dra7-evem, but, as was
identified during discussion [1], other hosts can also suffer from this
issue.  Fix all them at once by marking PCIe/PCI (MSI) IRQ cascade handlers
IRQF_NO_THREAD explicitly.

[1] http://lkml.kernel.org/r/1448027966-21610-1-git-send-email-grygorii.strashko@ti.com

[bhelgaas: add stable tag, fix typos]
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de> (for imx6)
CC: stable@vger.kernel.org
CC: Kishon Vijay Abraham I <kishon@ti.com>
CC: Jingoo Han <jingoohan1@gmail.com>
CC: Kukjin Kim <kgene@kernel.org>
CC: Krzysztof Kozlowski <k.kozlowski@samsung.com>
CC: Richard Zhu <Richard.Zhu@freescale.com>
CC: Thierry Reding <thierry.reding@gmail.com>
CC: Stephen Warren <swarren@wwwdotorg.org>
CC: Alexandre Courbot <gnurou@gmail.com>
CC: Simon Horman <horms@verge.net.au>
CC: Pratyush Anand <pratyush.anand@gmail.com>
CC: Michal Simek <michal.simek@xilinx.com>
CC: "Sören Brinkmann" <soren.brinkmann@xilinx.com>
CC: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
History 2016-02-03 14:01:44 -05:00
..
Kconfig PCI: iproc: Add Broadcom iProc PCIe support 2015-04-08 14:19:36 -05:00
Makefile PCI: iproc: Add Broadcom iProc PCIe support 2015-04-08 14:19:36 -05:00
pci-dra7xx.c PCI: host: Mark PCIe/PCI (MSI) IRQ cascade handlers as IRQF_NO_THREAD 2016-02-03 14:01:44 -05:00
pci-exynos.c PCI: host: Mark PCIe/PCI (MSI) IRQ cascade handlers as IRQF_NO_THREAD 2016-02-03 14:01:44 -05:00
pci-host-generic.c ACPI and power management updates for v3.20-rc1 2015-02-10 15:09:41 -08:00
pci-imx6.c PCI: host: Mark PCIe/PCI (MSI) IRQ cascade handlers as IRQF_NO_THREAD 2016-02-03 14:01:44 -05:00
pci-keystone-dw.c PCI: keystone: Don't dereference possible NULL pointer 2015-04-09 14:34:10 -05:00
pci-keystone.c PCI: keystone: Fix misspelling of current function in debug output 2015-01-09 11:30:32 -07:00
pci-keystone.h PCI/MSI: Rename "struct msi_chip" to "struct msi_controller" 2014-11-12 07:49:38 -07:00
pci-layerscape.c PCI: layerscape: Simplify platform_get_resource_byname() failure checking 2015-04-09 14:36:52 -05:00
pci-mvebu.c PCI: mvebu: Add suspend/resume support 2015-03-20 18:23:14 -05:00
pci-rcar-gen2.c PCI: rcar: Verify that mem_res is 64K-aligned 2015-02-24 00:24:19 -06:00
pci-tegra.c PCI: host: Mark PCIe/PCI (MSI) IRQ cascade handlers as IRQF_NO_THREAD 2016-02-03 14:01:44 -05:00
pci-versatile.c Merge branches 'pci/host-exynos', 'pci/host-iproc', 'pci/host-keystone', 'pci/host-layerscape', 'pci/host-mvebu', 'pci/host-rcar' and 'pci/host-versatile' into next 2015-04-10 08:26:54 -05:00
pci-xgene.c PCI: xgene: Add register offset to config space base address 2015-03-05 22:14:21 -06:00
pcie-designware.c PCI: spear: Drop __initdata from spear13xx_pcie_driver 2015-03-06 11:47:28 -06:00
pcie-designware.h PCI/MSI: Rename "struct msi_chip" to "struct msi_controller" 2014-11-12 07:49:38 -07:00
pcie-iproc-platform.c PCI: iproc: Add Broadcom iProc PCIe support 2015-04-08 14:19:36 -05:00
pcie-iproc.c PCI: iproc: Add Broadcom iProc PCIe support 2015-04-08 14:19:36 -05:00
pcie-iproc.h PCI: iproc: Add Broadcom iProc PCIe support 2015-04-08 14:19:36 -05:00
pcie-rcar.c PCI: host: Mark PCIe/PCI (MSI) IRQ cascade handlers as IRQF_NO_THREAD 2016-02-03 14:01:44 -05:00
pcie-spear13xx.c PCI: host: Mark PCIe/PCI (MSI) IRQ cascade handlers as IRQF_NO_THREAD 2016-02-03 14:01:44 -05:00
pcie-xilinx.c PCI: host: Mark PCIe/PCI (MSI) IRQ cascade handlers as IRQF_NO_THREAD 2016-02-03 14:01:44 -05:00