Skip to content

Commit e13cd66

Browse files
avpatelMarc Zyngier
authored andcommitted
irqchip/riscv-intc: Mark all INTC nodes as initialized
The RISC-V INTC local interrupts are per-HART (or per-CPU) so we create INTC IRQ domain only for the INTC node belonging to the boot HART. This means only the boot HART INTC node will be marked as initialized and other INTC nodes won't be marked which results downstream interrupt controllers (such as PLIC, IMSIC and APLIC direct-mode) not being probed due to missing device suppliers. To address this issue, we mark all INTC node for which we don't create IRQ domain as initialized. Reported-by: Dmitry Dunaev <dunaev@tecon.ru> Signed-off-by: Anup Patel <apatel@ventanamicro.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20230926102801.1591126-1-dunaev@tecon.ru Link: https://lore.kernel.org/r/20231003044403.1974628-4-apatel@ventanamicro.com
1 parent 3a0fff0 commit e13cd66

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/irqchip/irq-riscv-intc.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,16 @@ static int __init riscv_intc_init(struct device_node *node,
155155
* for each INTC DT node. We only need to do INTC initialization
156156
* for the INTC DT node belonging to boot CPU (or boot HART).
157157
*/
158-
if (riscv_hartid_to_cpuid(hartid) != smp_processor_id())
158+
if (riscv_hartid_to_cpuid(hartid) != smp_processor_id()) {
159+
/*
160+
* The INTC nodes of each CPU are suppliers for downstream
161+
* interrupt controllers (such as PLIC, IMSIC and APLIC
162+
* direct-mode) so we should mark an INTC node as initialized
163+
* if we are not creating IRQ domain for it.
164+
*/
165+
fwnode_dev_initialized(of_fwnode_handle(node), true);
159166
return 0;
167+
}
160168

161169
return riscv_intc_init_common(of_node_to_fwnode(node));
162170
}

0 commit comments

Comments
 (0)