Skip to contentSkip to conversation

of/irq: Fix root interrupt controller handling

PATCH Superseded Geert Uytterhoeven 3 participants 5 messages Oct 3, 2025 – Oct 6, 2025

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Geert Uytterhoeven

author maintainer
#0 lore raw

cover of/irq: Fix root interrupt controller handling

Hi all,

On ARM, the main interrupt controller is typically the GIC, and one can safely put "interrupt-parent = <&gic>;" in the root node. The GIC node has an interrupts property, but it points to itself, causing of_irq_init() to treat it as the root interrupt controller.

On RISC-V, the main interrupt controller is typically the PLIC. However, one can not put "interrupt-parent = <&plic>;" in the root node, as that would cause a kernel panic ("No interrupt controller found"). The main difference with ARM is that the PLIC is not the root interrupt
controller: its interrupt parent is the RISC-V CPU or Hart-Level Interrupt Controller (HLIC). The latter is the root interrupt controller, and despite having no interrupts property, it is currently not considered the root interrupt controller when an interrupt-parent property is present in the root node.

This series fixes the issue in of_irq_init(), and moves the "interrupt-parent = <&plic>;" for the RZ/Five (R9A07G043F) SoC from the soc node to the top node, like was done recently for the very similar RZ/G2UL (R9A07G043U) SoC[1].

Thanks for your comments!

[1] https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel.git/commit/?h=renesas-dts-for-v6.19&id=0070434f4a910179a23cd7ab812c33811f00b253)

Geert Uytterhoeven (2):
of/irq: Ignore interrupt parent for nodes without interrupts
riscv: dts: renesas: r9a07g043f: Move interrupt-parent to top node

 arch/riscv/boot/dts/renesas/r9a07g043f.dtsi | 3 ++-
 drivers/of/irq.c                            | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
Signature · 12 lines
2.43.0

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds
author maintainer
#1 lore raw

PATCH 1/2 of/irq: Ignore interrupt parent for nodes without interrupts

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.

---
 drivers/of/irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/irq.c +1 -1
index c29f0bef7798ec02..f155054e297c989a 100644
@@ -663,7 +663,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);
Signature · 1 line
2.43.0
maintainer
#2 lore raw

Re: [PATCH/RFC 1/2] of/irq: Ignore interrupt parent for nodes without interrupts

Quoted 13 lines · Geert Uytterhoeven

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:

Quoted 7 lines

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.

Seems reasonable. Why the RFC tag?

Normally I'd worry about some ancient PPC or Sparc system, but they don't use of_irq_init().

Rob

#3 lore raw

Re: [PATCH/RFC 1/2] of/irq: Ignore interrupt parent for nodes without interrupts

Hi Rob,

Quoted 17 lines · Rob Herring
Quoted 15 lines · Geert Uytterhoeven

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.

Quoted 6 lines
Quoted 4 lines

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.

Seems reasonable. Why the RFC tag?

Perhaps you might object to putting interrupt-parent in the root node if it does not point to the root interrupt controller, or if it does not help to simplify interrupts-extended to interrupts (like e.g. for ARM arch timer)?

Thanks!

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
author maintainer
#4 lore raw

PATCH 2/2 riscv: dts: renesas: r9a07g043f: Move interrupt-parent to top node

In reply to Geert Uytterhoeven

Move the "interrupt-parent = <&plic>" property from the soc node to the top node, for consistency with arch/arm64/boot/dts/renesas/r9a07g043u.dtsi.

---
 arch/riscv/boot/dts/renesas/r9a07g043f.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/riscv/boot/dts/renesas/r9a07g043f.dtsi +2 -1
index a8bcb26f42700644..571de3cafa8214e4 100644
@@ -12,6 +12,8 @@
 #include <arm64/renesas/r9a07g043.dtsi>
 
 / {
+	interrupt-parent = <&plic>;
+
 	cpus {
 		#address-cells = <1>;
 		#size-cells = <0>;
@@ -52,7 +54,6 @@ &pinctrl {
 
 &soc {
 	dma-noncoherent;
-	interrupt-parent = <&plic>;
 
 	irqc: interrupt-controller@110a0000 {
 		compatible = "renesas,r9a07g043f-irqc";
Signature · 1 line
2.43.0