Thread (19 messages) 19 messages, 9 authors, 2025-12-19

Re: [PATCH v2] of/irq: Ignore interrupt parent for nodes without interrupts

From: Ioana Ciornei <ioana.ciornei@nxp.com>
Date: 2025-11-28 17:09:09
Also in: linux-renesas-soc, linux-riscv, lkml

On Fri, Nov 28, 2025 at 06:42:53PM +0200, Ioana Ciornei wrote:
On Fri, Nov 14, 2025 at 11:47:54AM +0100, Geert Uytterhoeven wrote:
quoted
The Devicetree Specification states:

    The root of the interrupt tree is determined when traversal of the
    interrupt tree reaches an interrupt controller node without an
    interrupts property and thus no explicit interrupt parent.

However, of_irq_init() gratuitously assumes that a node without
interrupts has an actual interrupt parent if it finds an
interrupt-parent property higher up in the device tree.  Hence when such
a property is present (e.g. in the root node), the root interrupt
controller may not be detected as such, causing a panic:

    OF: of_irq_init: children remain, but no parents
    Kernel panic - not syncing: No interrupt controller found.

Commit e91033621d56e055 ("of/irq: Use interrupts-extended to find
parent") already fixed a first part, by checking for the presence of an
interrupts-extended property.  Fix the second part by only calling
of_irq_find_parent() when an interrupts property is present.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
v2:
  - Split off from series "[PATCH/RFC 0/2] of/irq: Fix root interrupt
    controller handling"[1] to relax dependencies,
  - Drop RFC.

[1] https://lore.kernel.org/all/cover.1759485668.git.geert+renesas@glider.be (local)
---
 drivers/of/irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/of/irq.c b/drivers/of/irq.c
index b174ec29648955c6..5cb1ca89c1d8725d 100644
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -613,7 +613,7 @@ void __init of_irq_init(const struct of_device_id *matches)
 		 * are the same distance away from the root irq controller.
 		 */
 		desc->interrupt_parent = of_parse_phandle(np, "interrupts-extended", 0);
-		if (!desc->interrupt_parent)
+		if (!desc->interrupt_parent && of_property_present(np, "interrupts"))
 			desc->interrupt_parent = of_irq_find_parent(np);
 		if (desc->interrupt_parent == np) {
 			of_node_put(desc->interrupt_parent);
-- 
2.43.0
Sorry, I somehow removed the verb from the initial email just before
sending it.

s/This change irq-ls-extirq/This change broke irq-ls-extirq

I also fixed it below.
This change broke irq-ls-extirq and commit 6ba51b7b34ca ("of/irq:
Handle explicit interrupt parent") does not help with the issue.

This is how the DT node in lx2160a.dtsi looks like:

	extirq: interrupt-controller@14 {
		compatible = "fsl,lx2160a-extirq", "fsl,ls1088a-extirq";
		#interrupt-cells = <2>;
		#address-cells = <0>;
		interrupt-controller;
		reg = <0x14 4>;
		interrupt-map =
			<0 0 &gic GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
			<1 0 &gic GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
			<2 0 &gic GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>,
			<3 0 &gic GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>,
			<4 0 &gic GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>,
			<5 0 &gic GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>,
			<6 0 &gic GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>,
			<7 0 &gic GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
			<8 0 &gic GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
			<9 0 &gic GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
			<10 0 &gic GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>,
			<11 0 &gic GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
		interrupt-map-mask = <0xf 0x0>;
	};

with the following being in the root node:

	interrupt-parent = <&gic>;

Ioana
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help