The number of interrupt enable register in words was once correct,
but was wrongly changed to have an off-by-one error since
commit
8c362e7d065e ("lib: irqchip/plic: Factor out a context init function").
Fixes:
8c362e7d065e ("lib: irqchip/plic: Factor out a context init function")
Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Samuel Holland <samuel@sholland.org>
if (!plic || context_id < 0)
return SBI_EINVAL;
- ie_words = (plic->num_src + 31) / 32;
+ ie_words = plic->num_src / 32 + 1;
ie_value = enable ? 0xffffffffU : 0U;
for (u32 i = 0; i < ie_words; i++)