mirror of https://gitee.com/openkylin/linux.git
irqchip/irq-sifive-plic: Check and continue in case of an invalid cpuid.
riscv_hartid_to_cpuid can return invalid cpuid for a hart that is present in DT but was never brought up. Print the appropriate warning message and continue. Signed-off-by: Atish Patra <atish.patra@wdc.com> Reviewed-by: Anup Patel <anup@brainfault.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
This commit is contained in:
parent
518bfe84ec
commit
fc03acaeab
|
@ -237,6 +237,11 @@ static int __init plic_init(struct device_node *node,
|
|||
}
|
||||
|
||||
cpu = riscv_hartid_to_cpuid(hartid);
|
||||
if (cpu < 0) {
|
||||
pr_warn("Invalid cpuid for context %d\n", i);
|
||||
continue;
|
||||
}
|
||||
|
||||
handler = per_cpu_ptr(&plic_handlers, cpu);
|
||||
handler->present = true;
|
||||
handler->ctxid = i;
|
||||
|
|
Loading…
Reference in New Issue