Commit f75e07bf authored by Lucas Zampieri's avatar Lucas Zampieri Committed by Thomas Gleixner
Browse files

irqchip/sifive-plic: Avoid interrupt ID 0 handling during suspend/resume



According to the PLIC specification[1], global interrupt sources are
assigned small unsigned integer identifiers beginning at the value 1.
An interrupt ID of 0 is reserved to mean "no interrupt".

The current plic_irq_resume() and plic_irq_suspend() functions incorrectly
start the loop from index 0, which accesses the register space for the
reserved interrupt ID 0.

Change the loop to start from index 1, skipping the reserved
interrupt ID 0 as per the PLIC specification.

This prevents potential undefined behavior when accessing the reserved
register space during suspend/resume cycles.

Fixes: e80f0b6a ("irqchip/irq-sifive-plic: Add syscore callbacks for hibernation")
Co-developed-by: default avatarJia Wang <wangjia@ultrarisc.com>
Signed-off-by: default avatarJia Wang <wangjia@ultrarisc.com>
Co-developed-by: default avatarCharles Mirabile <cmirabil@redhat.com>
Signed-off-by: default avatarCharles Mirabile <cmirabil@redhat.com>
Signed-off-by: default avatarLucas Zampieri <lzampier@redhat.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Link: https://github.com/riscv/riscv-plic-spec/releases/tag/1.0.0
parent 196754c2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment