[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <98e13934d06116d5c116bd2b2187842ec3a8c11a.1759485668.git.geert+renesas@glider.be>
Date: Fri, 3 Oct 2025 12:07:48 +0200
From: Geert Uytterhoeven <geert+renesas@...der.be>
To: Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Paul Walmsley <pjw@...nel.org>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>,
Alexandre Ghiti <alex@...ti.fr>,
Samuel Holland <samuel@...lland.org>,
Marc Zyngier <maz@...nel.org>,
Saravana Kannan <saravanak@...gle.com>,
Magnus Damm <magnus.damm@...il.com>
Cc: linux-renesas-soc@...r.kernel.org,
devicetree@...r.kernel.org,
linux-riscv@...ts.infradead.org,
linux-kernel@...r.kernel.org,
Geert Uytterhoeven <geert+renesas@...der.be>
Subject: [PATCH/RFC 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.
Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.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 c29f0bef7798ec02..f155054e297c989a 100644
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -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);
--
2.43.0
Powered by blists - more mailing lists