Skip to content

Commit 16870da

Browse files
grygoriySsashalevin
authored andcommitted
PCI: host: Mark PCIe/PCI (MSI) IRQ cascade handlers as IRQF_NO_THREAD
[ Upstream commit 8ff0ef9 ] 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/[email protected] [bhelgaas: add stable tag, fix typos] Signed-off-by: Grygorii Strashko <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Acked-by: Lucas Stach <[email protected]> (for imx6) CC: [email protected] CC: Kishon Vijay Abraham I <[email protected]> CC: Jingoo Han <[email protected]> CC: Kukjin Kim <[email protected]> CC: Krzysztof Kozlowski <[email protected]> CC: Richard Zhu <[email protected]> CC: Thierry Reding <[email protected]> CC: Stephen Warren <[email protected]> CC: Alexandre Courbot <[email protected]> CC: Simon Horman <[email protected]> CC: Pratyush Anand <[email protected]> CC: Michal Simek <[email protected]> CC: "Sören Brinkmann" <[email protected]> CC: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 24ab3b8 commit 16870da

File tree

7 files changed

+15
-8
lines changed

7 files changed

+15
-8
lines changed

drivers/pci/host/pci-dra7xx.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,8 @@ static int __init dra7xx_add_pcie_port(struct dra7xx_pcie *dra7xx,
289289
}
290290

291291
ret = devm_request_irq(&pdev->dev, pp->irq,
292-
dra7xx_pcie_msi_irq_handler, IRQF_SHARED,
292+
dra7xx_pcie_msi_irq_handler,
293+
IRQF_SHARED | IRQF_NO_THREAD,
293294
"dra7-pcie-msi", pp);
294295
if (ret) {
295296
dev_err(&pdev->dev, "failed to request irq\n");

drivers/pci/host/pci-exynos.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,8 @@ static int __init exynos_add_pcie_port(struct pcie_port *pp,
527527

528528
ret = devm_request_irq(&pdev->dev, pp->msi_irq,
529529
exynos_pcie_msi_irq_handler,
530-
IRQF_SHARED, "exynos-pcie", pp);
530+
IRQF_SHARED | IRQF_NO_THREAD,
531+
"exynos-pcie", pp);
531532
if (ret) {
532533
dev_err(&pdev->dev, "failed to request msi irq\n");
533534
return ret;

drivers/pci/host/pci-imx6.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,8 @@ static int __init imx6_add_pcie_port(struct pcie_port *pp,
534534

535535
ret = devm_request_irq(&pdev->dev, pp->msi_irq,
536536
imx6_pcie_msi_handler,
537-
IRQF_SHARED, "mx6-pcie-msi", pp);
537+
IRQF_SHARED | IRQF_NO_THREAD,
538+
"mx6-pcie-msi", pp);
538539
if (ret) {
539540
dev_err(&pdev->dev, "failed to request MSI irq\n");
540541
return -ENODEV;

drivers/pci/host/pci-tegra.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1304,7 +1304,7 @@ static int tegra_pcie_enable_msi(struct tegra_pcie *pcie)
13041304

13051305
msi->irq = err;
13061306

1307-
err = request_irq(msi->irq, tegra_pcie_msi_irq, 0,
1307+
err = request_irq(msi->irq, tegra_pcie_msi_irq, IRQF_NO_THREAD,
13081308
tegra_msi_irq_chip.name, pcie);
13091309
if (err < 0) {
13101310
dev_err(&pdev->dev, "failed to request IRQ: %d\n", err);

drivers/pci/host/pcie-rcar.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -695,14 +695,16 @@ static int rcar_pcie_enable_msi(struct rcar_pcie *pcie)
695695

696696
/* Two irqs are for MSI, but they are also used for non-MSI irqs */
697697
err = devm_request_irq(&pdev->dev, msi->irq1, rcar_pcie_msi_irq,
698-
IRQF_SHARED, rcar_msi_irq_chip.name, pcie);
698+
IRQF_SHARED | IRQF_NO_THREAD,
699+
rcar_msi_irq_chip.name, pcie);
699700
if (err < 0) {
700701
dev_err(&pdev->dev, "failed to request IRQ: %d\n", err);
701702
goto err;
702703
}
703704

704705
err = devm_request_irq(&pdev->dev, msi->irq2, rcar_pcie_msi_irq,
705-
IRQF_SHARED, rcar_msi_irq_chip.name, pcie);
706+
IRQF_SHARED | IRQF_NO_THREAD,
707+
rcar_msi_irq_chip.name, pcie);
706708
if (err < 0) {
707709
dev_err(&pdev->dev, "failed to request IRQ: %d\n", err);
708710
goto err;

drivers/pci/host/pcie-spear13xx.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,8 @@ static int spear13xx_add_pcie_port(struct pcie_port *pp,
281281
return -ENODEV;
282282
}
283283
ret = devm_request_irq(dev, pp->irq, spear13xx_pcie_irq_handler,
284-
IRQF_SHARED, "spear1340-pcie", pp);
284+
IRQF_SHARED | IRQF_NO_THREAD,
285+
"spear1340-pcie", pp);
285286
if (ret) {
286287
dev_err(dev, "failed to request irq %d\n", pp->irq);
287288
return ret;

drivers/pci/host/pcie-xilinx.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,8 @@ static int xilinx_pcie_parse_dt(struct xilinx_pcie_port *port)
776776

777777
port->irq = irq_of_parse_and_map(node, 0);
778778
err = devm_request_irq(dev, port->irq, xilinx_pcie_intr_handler,
779-
IRQF_SHARED, "xilinx-pcie", port);
779+
IRQF_SHARED | IRQF_NO_THREAD,
780+
"xilinx-pcie", port);
780781
if (err) {
781782
dev_err(dev, "unable to request irq %d\n", port->irq);
782783
return err;

0 commit comments

Comments
 (0)