Skip to content

Commit a9c3ee5

Browse files
chenhuacaiKAGA-KOKO
authored andcommitted
irqchip/loongson-liointc: Set different ISRs for different cores
The liointc hardware provides separate Interrupt Status Registers (ISR) for each core. The current code uses always the ISR of core #0, which works during boot because by default all interrupts are routed to core #0. When the interrupt routing changes in the firmware configuration then this causes interrupts to be lost because they are not configured in the corresponding core. Use the core index to access the correct ISR instead of a hardcoded 0. [ tglx: Massaged changelog ] Fixes: 0858ed0 ("irqchip/loongson-liointc: Add ACPI init support") Co-developed-by: Tianli Xiong <xiongtianli@loongson.cn> Signed-off-by: Tianli Xiong <xiongtianli@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20240622043338.1566945-1-chenhuacai@loongson.cn
1 parent 2d64eae commit a9c3ee5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/irqchip/irq-loongson-liointc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
#define LIOINTC_INTC_CHIP_START 0x20
3030

31-
#define LIOINTC_REG_INTC_STATUS (LIOINTC_INTC_CHIP_START + 0x20)
31+
#define LIOINTC_REG_INTC_STATUS(core) (LIOINTC_INTC_CHIP_START + 0x20 + (core) * 8)
3232
#define LIOINTC_REG_INTC_EN_STATUS (LIOINTC_INTC_CHIP_START + 0x04)
3333
#define LIOINTC_REG_INTC_ENABLE (LIOINTC_INTC_CHIP_START + 0x08)
3434
#define LIOINTC_REG_INTC_DISABLE (LIOINTC_INTC_CHIP_START + 0x0c)
@@ -217,7 +217,7 @@ static int liointc_init(phys_addr_t addr, unsigned long size, int revision,
217217
goto out_free_priv;
218218

219219
for (i = 0; i < LIOINTC_NUM_CORES; i++)
220-
priv->core_isr[i] = base + LIOINTC_REG_INTC_STATUS;
220+
priv->core_isr[i] = base + LIOINTC_REG_INTC_STATUS(i);
221221

222222
for (i = 0; i < LIOINTC_NUM_PARENT; i++)
223223
priv->handler[i].parent_int_map = parent_int_map[i];

0 commit comments

Comments
 (0)