diff options
| author | Anup Patel <anup.patel@oss.qualcomm.com> | 2026-02-13 11:23:37 +0530 |
|---|---|---|
| committer | Anup Patel <anup@brainfault.org> | 2026-03-22 10:52:43 +0530 |
| commit | 6d68f3bebd206314a5b194004249524dbc0da075 (patch) | |
| tree | 6fcbf4d70f18b3bb2fbfb9a662fb848f9738f32a | |
| parent | 2110aab68fd2e33151416c1ca3070fbb79db814c (diff) | |
| download | opensbi-6d68f3bebd206314a5b194004249524dbc0da075.tar.gz opensbi-6d68f3bebd206314a5b194004249524dbc0da075.tar.bz2 opensbi-6d68f3bebd206314a5b194004249524dbc0da075.zip | |
lib: utils/irqchip: Fix context_map init in irqchip_plic_update_context_map()
The context_map[][] elements should be initialized with negative
value so that context_map does not point to anything for non-existent
PLIC contexts.
Fixes: 69448a079065 ("lib: utils/irqchip: plic: Provide a hartindex to context map")
Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260213055342.3124872-4-anup.patel@oss.qualcomm.com
Signed-off-by: Anup Patel <anup@brainfault.org>
| -rw-r--r-- | lib/utils/irqchip/fdt_irqchip_plic.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/utils/irqchip/fdt_irqchip_plic.c b/lib/utils/irqchip/fdt_irqchip_plic.c index 65a9de15..61c68ac9 100644 --- a/lib/utils/irqchip/fdt_irqchip_plic.c +++ b/lib/utils/irqchip/fdt_irqchip_plic.c @@ -24,6 +24,11 @@ static int irqchip_plic_update_context_map(const void *fdt, int nodeoff, u32 phandle, hwirq, hartid, hartindex; int i, err, count, cpu_offset, cpu_intc_offset; + for (i = 0; i < sbi_hart_count(); i++) { + pd->context_map[i][PLIC_M_CONTEXT] = -1; + pd->context_map[i][PLIC_S_CONTEXT] = -1; + } + val = fdt_getprop(fdt, nodeoff, "interrupts-extended", &count); if (!val || count < sizeof(fdt32_t)) return SBI_EINVAL; |
