lib: sbi_irqchip: Allow marking hardware interrupts as reserved

Some of the hardware interrupts may be special so allow irqchip
drivers to make these hardware interrupts as reserved. Introduce
sbi_irqchip_register_reserved() for this purpose.

Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260423052339.356900-5-anup.patel@oss.qualcomm.com
Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Anup Patel
2026-04-23 10:53:37 +05:30
committed by Anup Patel
parent adb4caf765
commit d861447b0b
3 changed files with 44 additions and 13 deletions
+6 -1
View File
@@ -348,7 +348,7 @@ int imsic_data_check(struct imsic_data *imsic)
static int imsic_hwirq_setup(struct sbi_irqchip_device *chip, u32 hwirq, u32 hwirq_flags)
{
if (!hwirq || hwirq == IMSIC_IPI_ID || hwirq_flags != SBI_HWIRQ_FLAGS_NONE)
if (hwirq_flags != SBI_HWIRQ_FLAGS_NONE)
return SBI_ENOTSUPP;
return 0;
}
@@ -406,6 +406,11 @@ int imsic_cold_irqchip_init(struct imsic_data *imsic)
if (rc)
return rc;
/* Mark hwirq 0 and IPI hwirq as reserved */
rc = sbi_irqchip_register_reserved(&imsic_device, 0, IMSIC_IPI_ID + 1);
if (rc)
return rc;
/* Register IPI device */
sbi_ipi_add_device(&imsic_ipi_device);