Skip to content

Commit 1b1f04d

Browse files
geerturobherring
authored andcommitted
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 e910336 ("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> Link: https://patch.msgid.link/fbe6fc3657070fe2df7f0529043542b52b827449.1763116833.git.geert+renesas@glider.be Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
1 parent c749659 commit 1b1f04d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/of/irq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ void __init of_irq_init(const struct of_device_id *matches)
593593
* are the same distance away from the root irq controller.
594594
*/
595595
desc->interrupt_parent = of_parse_phandle(np, "interrupts-extended", 0);
596-
if (!desc->interrupt_parent)
596+
if (!desc->interrupt_parent && of_property_present(np, "interrupts"))
597597
desc->interrupt_parent = of_irq_find_parent(np);
598598
if (desc->interrupt_parent == np) {
599599
of_node_put(desc->interrupt_parent);

0 commit comments

Comments
 (0)