lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdXsZwDaT8L5z9KzyX0FF4WVbvZhsGAtSK7pJ=nCr4hE4Q@mail.gmail.com>
Date: Mon, 1 Dec 2025 13:50:58 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Rob Herring <robh@...nel.org>
Cc: Ioana Ciornei <ioana.ciornei@....com>, Saravana Kannan <saravanak@...gle.com>, 
	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>, 
	Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>, 
	Magnus Damm <magnus.damm@...il.com>, devicetree@...r.kernel.org, 
	linux-renesas-soc@...r.kernel.org, linux-riscv@...ts.infradead.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] of/irq: Ignore interrupt parent for nodes without interrupts

Hi Rob,

Thanks, I was just looking into this...

On Mon, 1 Dec 2025 at 13:09, Rob Herring <robh@...nel.org> wrote:
> On Fri, Nov 28, 2025 at 10:43 AM Ioana Ciornei <ioana.ciornei@....com> wrote:
> > On Fri, Nov 14, 2025 at 11:47:54AM +0100, Geert Uytterhoeven 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.
> > >
> > > Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>

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

> > This change 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:
>
> ls-extirq strikes again!
>
> I think something like this should fix it:
>
> diff --git a/drivers/of/irq.c b/drivers/of/irq.c
> index 2271110b5f7c..c06c74aef801 100644
> --- a/drivers/of/irq.c
> +++ b/drivers/of/irq.c
> @@ -593,7 +593,8 @@ 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 && of_property_present(np, "interrupts"))
> +               if (!desc->interrupt_parent &&
> +                   (of_property_present(np, "interrupts") || of_property_present(np, "interrupt-map"))

That should indeed restore the previous behavior, and find again
"interrupt-parent = &gic" in the root node.  However, wouldn't it
be more correct to follow the approach used for interrupts-extended,
and use the first interrupt parent from the interrupt-map (which is
coincidentally &gic, too)?

>                         desc->interrupt_parent = of_irq_find_parent(np);
>                 else if (!desc->interrupt_parent)
>                         desc->interrupt_parent = of_parse_phandle(np, "interrupt-parent", 0);
>
> But really, at some point it should be converted to a proper driver as
> there's no reason extirq needs to be initialized early.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ