linux/drivers/irqchip
Lucas Zampieri f75e07bf52 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: e80f0b6a2c ("irqchip/irq-sifive-plic: Add syscore callbacks for hibernation")
Co-developed-by: Jia Wang <wangjia@ultrarisc.com>
Signed-off-by: Jia Wang <wangjia@ultrarisc.com>
Co-developed-by: Charles Mirabile <cmirabil@redhat.com>
Signed-off-by: Charles Mirabile <cmirabil@redhat.com>
Signed-off-by: Lucas Zampieri <lzampier@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://github.com/riscv/riscv-plic-spec/releases/tag/1.0.0
2025-10-07 10:23:22 +02:00
..
alphascale_asm9260-icoll.h
exynos-combiner.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-aclint-sswi.c irqchip/aslint-sswi: Resolve hart index 2025-06-26 16:06:40 +02:00
irq-al-fic.c A set of cleanups for the generic interrupt subsystem: 2025-05-27 08:07:32 -07:00
irq-alpine-msi.c irqchip/alpine-msi: Switch to msi_create_parent_irq_domain() 2025-07-03 15:49:25 +02:00
irq-apple-aic.c irqchip: Switch to of_fwnode_handle() 2025-05-16 21:06:07 +02:00
irq-armada-370-xp.c irqchip/armada-370-xp: Switch to msi_create_parent_irq_domain() 2025-07-03 15:49:25 +02:00
irq-aspeed-i2c-ic.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-aspeed-intc.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-aspeed-scu-ic.c irqchip/aspeed-scu-ic: Fix an IS_ERR() vs NULL check 2025-10-07 10:23:22 +02:00
irq-aspeed-vic.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-ath79-cpu.c
irq-ath79-misc.c irqchip/ath79-misc: Fix missing prototypes warnings 2025-06-20 21:38:52 +02:00
irq-atmel-aic-common.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-atmel-aic-common.h
irq-atmel-aic.c irqchip/atmel-aic[5]: Fix incorrect lock guard conversion 2025-08-23 21:41:07 +02:00
irq-atmel-aic5.c irqchip/atmel-aic[5]: Fix incorrect lock guard conversion 2025-08-23 21:41:07 +02:00
irq-bcm2712-mip.c irqchip/bcm2712-mip: Switch to msi_create_parent_irq_domain() 2025-07-03 15:49:24 +02:00
irq-bcm2835.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-bcm2836.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-bcm6345-l1.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-bcm7038-l1.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-bcm7120-l2.c A set of cleanups for the generic interrupt subsystem: 2025-05-27 08:07:32 -07:00
irq-brcmstb-l2.c A set of cleanups for the generic interrupt subsystem: 2025-05-27 08:07:32 -07:00
irq-clps711x.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-crossbar.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-csky-apb-intc.c A set of cleanups for the generic interrupt subsystem: 2025-05-27 08:07:32 -07:00
irq-csky-mpintc.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-davinci-cp-intc.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-digicolor.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-dw-apb-ictl.c A set of cleanups for the generic interrupt subsystem: 2025-05-27 08:07:32 -07:00
irq-econet-en751221.c irqchip/econet-en751221: Switch to of_fwnode_handle() 2025-05-13 16:39:03 +02:00
irq-ftintc010.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-gic-common.c
irq-gic-common.h irqchip/gic-v3: Rename GICv3 ITS MSI parent 2025-07-08 18:35:52 +01:00
irq-gic-its-msi-parent.c irqchip/gic-v5: Add GICv5 ITS support 2025-07-08 18:35:52 +01:00
irq-gic-its-msi-parent.h irqchip/gic-v5: Add GICv5 ITS support 2025-07-08 18:35:52 +01:00
irq-gic-pm.c
irq-gic-realview.c
irq-gic-v2m.c irqchip/gic-v2m: Handle Multiple MSI base IRQ Alignment 2025-09-04 14:52:47 +02:00
irq-gic-v3-its-fsl-mc-msi.c of/irq: Convert of_msi_map_id() callers to of_msi_xlate() 2025-09-03 09:01:26 -05:00
irq-gic-v3-its.c irqchip/gic-v3: Rename GICv3 ITS MSI parent 2025-07-08 18:35:52 +01:00
irq-gic-v3-mbi.c Updates for the MSI subsystem (core code and PCI): 2025-05-27 08:15:26 -07:00
irq-gic-v3.c irqchip: Use int type to store negative error codes 2025-09-03 14:10:30 +02:00
irq-gic-v4.c KVM: arm64: WARN if unmapping a vLPI fails in any path 2025-06-20 13:52:29 -07:00
irq-gic-v5-irs.c Updates for interrupt chip drivers: 2025-09-30 16:00:29 -07:00
irq-gic-v5-its.c irqchip/gic-v5: Fix error handling in gicv5_its_irq_domain_alloc() 2025-09-09 11:51:09 +02:00
irq-gic-v5-iwb.c irqchip/gic-v5: iwb: Fix iounmap probe failure path 2025-08-05 10:43:48 +02:00
irq-gic-v5.c irqchip/gic-v5: Drop has_gcie_v3_compat from gic_kvm_info 2025-09-17 17:41:02 +01:00
irq-gic.c arm64: cpucaps: Rename GICv3 CPU interface capability 2025-07-08 18:35:51 +01:00
irq-goldfish-pic.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-hip04.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-i8259.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-idt3243x.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-imgpdc.c irqchip: Use dev_fwnode() 2025-06-12 15:08:12 +02:00
irq-imx-gpcv2.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-imx-intmux.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-imx-irqsteer.c irqchip: Use dev_fwnode() 2025-06-12 15:08:12 +02:00
irq-imx-mu-msi.c irqchip/imx-mu-msi: Convert to msi_create_parent_irq_domain() helper 2025-07-03 15:49:24 +02:00
irq-ingenic-tcu.c A set of cleanups for the generic interrupt subsystem: 2025-05-27 08:07:32 -07:00
irq-ingenic.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-ixp4xx.c irqchip: Switch to of_fwnode_handle() 2025-05-16 21:06:07 +02:00
irq-jcore-aic.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-keystone.c irqchip: Use dev_fwnode() 2025-06-12 15:08:12 +02:00
irq-lan966x-oic.c A set of cleanups for the generic interrupt subsystem: 2025-05-27 08:07:32 -07:00
irq-loongarch-avec.c irqchip: Make irq-msi-lib.h globally available 2025-05-16 21:32:19 +02:00
irq-loongarch-cpu.c irqchip: Switch to of_fwnode_handle() 2025-05-16 21:06:07 +02:00
irq-loongson-eiointc.c irqchip/loongson-eiointc: Add multiple interrupt pin routing support 2025-08-24 12:51:04 +02:00
irq-loongson-htpic.c
irq-loongson-htvec.c irqchip: Switch to of_fwnode_handle() 2025-05-16 21:06:07 +02:00
irq-loongson-liointc.c A set of cleanups for the generic interrupt subsystem: 2025-05-27 08:07:32 -07:00
irq-loongson-pch-lpc.c irqchip/loongson-pch-lpc: Use legacy domain for PCH-LPC IRQ controller 2025-09-09 22:37:57 +02:00
irq-loongson-pch-msi.c irqchip/loongson-pch-msi.c: Switch to msi_create_parent_irq_domain() 2025-07-03 15:49:24 +02:00
irq-loongson-pch-pic.c irqchip: Switch to of_fwnode_handle() 2025-05-16 21:06:07 +02:00
irq-loongson.h
irq-lpc32xx.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-ls-extirq.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-ls-scfg-msi.c irqchip/ls-scfg-msi: Fix NULL dereference in error handling 2025-07-18 14:54:45 +02:00
irq-ls1x.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-madera.c
irq-mbigen.c
irq-mchp-eic.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-meson-gpio.c irqchip: Switch to of_fwnode_handle() 2025-05-16 21:06:07 +02:00
irq-mips-cpu.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-mips-gic.c irqchip/mips-gic: Allow forced affinity 2025-06-21 18:20:54 +02:00
irq-mmp.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-mscc-ocelot.c A set of cleanups for the generic interrupt subsystem: 2025-05-27 08:07:32 -07:00
irq-msi-lib.c irqchip/msi-lib: Honor the MSI_FLAG_PCI_MSI_MASK_PARENT flag 2025-09-09 14:44:30 +02:00
irq-mst-intc.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-mtk-cirq.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-mtk-sysirq.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-mvebu-gicp.c irqchip/mvebu-gicp: Fix an IS_ERR() vs NULL check in probe() 2025-08-24 12:00:47 +02:00
irq-mvebu-icu.c irqchip: Make irq-msi-lib.h globally available 2025-05-16 21:32:19 +02:00
irq-mvebu-odmi.c Updates for the MSI subsystem (core code and PCI): 2025-05-27 08:15:26 -07:00
irq-mvebu-pic.c irqchip: Use dev_fwnode() 2025-06-12 15:08:12 +02:00
irq-mvebu-sei.c irqchip/mvebu: Convert to msi_create_parent_irq_domain() helper 2025-05-16 21:32:20 +02:00
irq-mxs.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-nvic.c irqchip: Use int type to store negative error codes 2025-09-03 14:10:30 +02:00
irq-omap-intc.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-ompic.c
irq-or1k-pic.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-orion.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-owl-sirq.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-partition-percpu.c
irq-pic32-evic.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-pruss-intc.c irqchip: Use dev_fwnode() 2025-06-12 15:08:12 +02:00
irq-qcom-mpm.c A set of cleanups for the generic interrupt subsystem: 2025-05-27 08:07:32 -07:00
irq-rda-intc.c
irq-realtek-rtl.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-renesas-intc-irqpin.c irqchip/renesas-intc-irqpin: Convert to DEFINE_SIMPLE_DEV_PM_OPS() 2025-07-18 16:46:09 +02:00
irq-renesas-irqc.c irqchip/renesas-irqc: Convert to DEFINE_SIMPLE_DEV_PM_OPS() 2025-07-18 16:46:09 +02:00
irq-renesas-rza1.c irqchip: Use int type to store negative error codes 2025-09-03 14:10:30 +02:00
irq-renesas-rzg2l.c irqchip/renesas-rzg2l: Remove dev_err_probe() if error is -ENOMEM 2025-09-03 14:12:55 +02:00
irq-renesas-rzv2h.c irqchip/renesas-rzv2h: Remove unneeded includes 2025-07-02 16:05:36 +02:00
irq-riscv-aplic-direct.c irqchip/riscv-aplic: Use riscv_get_hart_index() 2025-06-26 16:06:40 +02:00
irq-riscv-aplic-main.c
irq-riscv-aplic-main.h
irq-riscv-aplic-msi.c
irq-riscv-imsic-early.c irqchip/irq-riscv-imsic-early: Export imsic_acpi_get_fwnode() 2025-09-25 19:49:15 -06:00
irq-riscv-imsic-platform.c irqchip/riscv-imsic: Don't dereference before NULL pointer check 2025-08-05 10:29:24 +02:00
irq-riscv-imsic-state.c irqchip/riscv-imsic: Add kernel parameter to disable IPIs 2025-07-18 16:46:09 +02:00
irq-riscv-imsic-state.h irqchip/riscv-imsic: Add kernel parameter to disable IPIs 2025-07-18 16:46:09 +02:00
irq-riscv-intc.c irqchip: Switch to of_fwnode_handle() 2025-05-16 21:06:07 +02:00
irq-riscv-rpmi-sysmsi.c irqchip/riscv-rpmi-sysmsi: Add ACPI support 2025-09-25 19:49:19 -06:00
irq-sa11x0.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-sg2042-msi.c irqchip/sg2042-msi: Set irq type according to DT configuration 2025-09-04 14:52:48 +02:00
irq-sifive-plic.c irqchip/sifive-plic: Avoid interrupt ID 0 handling during suspend/resume 2025-10-07 10:23:22 +02:00
irq-sl28cpld.c
irq-sni-exiu.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-sp7021-intc.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-st.c
irq-starfive-jh8100-intc.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-stm32-exti.c A set of cleanups for the generic interrupt subsystem: 2025-05-27 08:07:32 -07:00
irq-stm32mp-exti.c irqchip: Use dev_fwnode() 2025-06-12 15:08:12 +02:00
irq-sun4i.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-sun6i-r.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-sunxi-nmi.c A set of cleanups for the generic interrupt subsystem: 2025-05-27 08:07:32 -07:00
irq-tb10x.c A set of cleanups for the generic interrupt subsystem: 2025-05-27 08:07:32 -07:00
irq-tegra.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-ti-sci-inta.c irqchip: Use dev_fwnode() 2025-06-12 15:08:12 +02:00
irq-ti-sci-intr.c irqchip: Use dev_fwnode() 2025-06-12 15:08:12 +02:00
irq-ts4800.c irqchip: Use dev_fwnode() 2025-06-12 15:08:12 +02:00
irq-uniphier-aidet.c irqchip: Switch to of_fwnode_handle() 2025-05-16 21:06:07 +02:00
irq-versatile-fpga.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-vf610-mscm-ir.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-vic.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-vt8500.c irqchip/irq-vt8500: Switch to irq_domain_create_*() 2025-05-07 15:36:56 +02:00
irq-wpcm450-aic.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-xilinx-intc.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-xtensa-mx.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-xtensa-pic.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irq-zevio.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00
irqchip.c
Kconfig irqchip/riscv-rpmi-sysmsi: Add ACPI support 2025-09-25 19:49:19 -06:00
Makefile irqchip: Add driver for the RPMI system MSI service group 2025-09-25 14:31:56 -06:00
qcom-irq-combiner.c
qcom-pdc.c
spear-shirq.c irqchip: Switch to irq_domain_create_*() 2025-05-16 21:06:09 +02:00