Commit f75e07b
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: e80f0b6 ("irqchip/irq-sifive-plic: Add syscore callbacks for hibernation")
Co-developed-by: Jia Wang <[email protected]>
Signed-off-by: Jia Wang <[email protected]>
Co-developed-by: Charles Mirabile <[email protected]>
Signed-off-by: Charles Mirabile <[email protected]>
Signed-off-by: Lucas Zampieri <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://github.com/riscv/riscv-plic-spec/releases/tag/1.0.01 parent 196754c commit f75e07b
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
| 257 | + | |
| 258 | + | |
258 | 259 | | |
259 | 260 | | |
260 | 261 | | |
| |||
285 | 286 | | |
286 | 287 | | |
287 | 288 | | |
288 | | - | |
| 289 | + | |
| 290 | + | |
289 | 291 | | |
290 | 292 | | |
291 | 293 | | |
| |||
0 commit comments