devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] of/irq: Ignore interrupt parent for nodes without interrupts
@ 2025-11-14 10:47 Geert Uytterhoeven
  2025-11-17 17:27 ` Rob Herring (Arm)
  2025-11-18 19:34 ` Mark Brown
  0 siblings, 2 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2025-11-14 10:47 UTC (permalink / raw)
  To: Rob Herring, Saravana Kannan, Krzysztof Kozlowski, Conor Dooley
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	Samuel Holland, Marc Zyngier, Lad Prabhakar, Magnus Damm,
	devicetree, linux-renesas-soc, linux-riscv, linux-kernel,
	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.

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
---
 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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-11-20 10:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-14 10:47 [PATCH v2] of/irq: Ignore interrupt parent for nodes without interrupts Geert Uytterhoeven
2025-11-17 17:27 ` Rob Herring (Arm)
2025-11-18 19:34 ` Mark Brown
2025-11-18 19:55   ` Krzysztof Kozlowski
2025-11-19  8:53     ` Geert Uytterhoeven
2025-11-19  9:55       ` Marek Szyprowski
2025-11-19 10:59         ` Geert Uytterhoeven
2025-11-20 10:11       ` Jon Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).