* [PATCH/RFC 0/2] of/irq: Fix root interrupt controller handling
@ 2025-10-03 10:07 Geert Uytterhoeven
2025-10-03 10:07 ` [PATCH/RFC 1/2] of/irq: Ignore interrupt parent for nodes without interrupts Geert Uytterhoeven
2025-10-03 10:07 ` [PATCH/RFC 2/2] riscv: dts: renesas: r9a07g043f: Move interrupt-parent to top node Geert Uytterhoeven
0 siblings, 2 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2025-10-03 10:07 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Samuel Holland,
Marc Zyngier, Saravana Kannan, Magnus Damm
Cc: linux-renesas-soc, devicetree, linux-riscv, linux-kernel,
Geert Uytterhoeven
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(-)
--
2.43.0
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH/RFC 1/2] of/irq: Ignore interrupt parent for nodes without interrupts
2025-10-03 10:07 [PATCH/RFC 0/2] of/irq: Fix root interrupt controller handling Geert Uytterhoeven
@ 2025-10-03 10:07 ` Geert Uytterhoeven
2025-10-03 13:32 ` Rob Herring
2025-10-03 10:07 ` [PATCH/RFC 2/2] riscv: dts: renesas: r9a07g043f: Move interrupt-parent to top node Geert Uytterhoeven
1 sibling, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2025-10-03 10:07 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Samuel Holland,
Marc Zyngier, Saravana Kannan, Magnus Damm
Cc: linux-renesas-soc, devicetree, 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>
---
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH/RFC 2/2] riscv: dts: renesas: r9a07g043f: Move interrupt-parent to top node
2025-10-03 10:07 [PATCH/RFC 0/2] of/irq: Fix root interrupt controller handling Geert Uytterhoeven
2025-10-03 10:07 ` [PATCH/RFC 1/2] of/irq: Ignore interrupt parent for nodes without interrupts Geert Uytterhoeven
@ 2025-10-03 10:07 ` Geert Uytterhoeven
1 sibling, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2025-10-03 10:07 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Samuel Holland,
Marc Zyngier, Saravana Kannan, Magnus Damm
Cc: linux-renesas-soc, devicetree, linux-riscv, linux-kernel,
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.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
arch/riscv/boot/dts/renesas/r9a07g043f.dtsi | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/riscv/boot/dts/renesas/r9a07g043f.dtsi b/arch/riscv/boot/dts/renesas/r9a07g043f.dtsi
index a8bcb26f42700644..571de3cafa8214e4 100644
--- a/arch/riscv/boot/dts/renesas/r9a07g043f.dtsi
+++ b/arch/riscv/boot/dts/renesas/r9a07g043f.dtsi
@@ -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";
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH/RFC 1/2] of/irq: Ignore interrupt parent for nodes without interrupts
2025-10-03 10:07 ` [PATCH/RFC 1/2] of/irq: Ignore interrupt parent for nodes without interrupts Geert Uytterhoeven
@ 2025-10-03 13:32 ` Rob Herring
2025-10-06 7:35 ` Geert Uytterhoeven
0 siblings, 1 reply; 5+ messages in thread
From: Rob Herring @ 2025-10-03 13:32 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Krzysztof Kozlowski, Conor Dooley, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Samuel Holland, Marc Zyngier,
Saravana Kannan, Magnus Damm, linux-renesas-soc, devicetree,
linux-riscv, linux-kernel
On Fri, Oct 3, 2025 at 5:08 AM Geert Uytterhoeven
<geert+renesas@glider.be> wrote:
>
> 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.
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH/RFC 1/2] of/irq: Ignore interrupt parent for nodes without interrupts
2025-10-03 13:32 ` Rob Herring
@ 2025-10-06 7:35 ` Geert Uytterhoeven
0 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2025-10-06 7:35 UTC (permalink / raw)
To: Rob Herring
Cc: Krzysztof Kozlowski, Conor Dooley, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Samuel Holland, Marc Zyngier,
Saravana Kannan, Magnus Damm, linux-renesas-soc, devicetree,
linux-riscv, linux-kernel
Hi Rob,
On Fri, 3 Oct 2025 at 15:33, Rob Herring <robh@kernel.org> wrote:
> On Fri, Oct 3, 2025 at 5:08 AM Geert Uytterhoeven
> <geert+renesas@glider.be> wrote:
> > 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.
>
> 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
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-10-06 7:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-03 10:07 [PATCH/RFC 0/2] of/irq: Fix root interrupt controller handling Geert Uytterhoeven
2025-10-03 10:07 ` [PATCH/RFC 1/2] of/irq: Ignore interrupt parent for nodes without interrupts Geert Uytterhoeven
2025-10-03 13:32 ` Rob Herring
2025-10-06 7:35 ` Geert Uytterhoeven
2025-10-03 10:07 ` [PATCH/RFC 2/2] riscv: dts: renesas: r9a07g043f: Move interrupt-parent to top node Geert Uytterhoeven
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).