Skip to content

Commit 2af2573

Browse files
zhangtianyang-ztyKAGA-KOKO
authored andcommitted
irqchip/loongarch-avec: Add multi-nodes topology support
avecintc_init() enables the Advanced Interrupt Controller (AVEC) of the boot CPU node, but nothing enables the AVEC on secondary nodes. Move the enablement to the CPU hotplug callback so that secondary nodes get the AVEC enabled too. In theory enabling it once per node would be sufficient, but redundant enabling does no hurt, so keep the code simple and do it unconditionally. Signed-off-by: Tianyang Zhang <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Huacai Chen <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent e3ab1fc commit 2af2573

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

drivers/irqchip/irq-loongarch-avec.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,15 @@ struct avecintc_data {
5656
unsigned int moving;
5757
};
5858

59+
static inline void avecintc_enable(void)
60+
{
61+
u64 value;
62+
63+
value = iocsr_read64(LOONGARCH_IOCSR_MISC_FUNC);
64+
value |= IOCSR_MISC_FUNC_AVEC_EN;
65+
iocsr_write64(value, LOONGARCH_IOCSR_MISC_FUNC);
66+
}
67+
5968
static inline void avecintc_ack_irq(struct irq_data *d)
6069
{
6170
}
@@ -127,6 +136,8 @@ static int avecintc_cpu_online(unsigned int cpu)
127136

128137
guard(raw_spinlock)(&loongarch_avec.lock);
129138

139+
avecintc_enable();
140+
130141
irq_matrix_online(loongarch_avec.vector_matrix);
131142

132143
pending_list_init(cpu);
@@ -339,7 +350,6 @@ static int __init irq_matrix_init(void)
339350
static int __init avecintc_init(struct irq_domain *parent)
340351
{
341352
int ret, parent_irq;
342-
unsigned long value;
343353

344354
raw_spin_lock_init(&loongarch_avec.lock);
345355

@@ -378,9 +388,7 @@ static int __init avecintc_init(struct irq_domain *parent)
378388
"irqchip/loongarch/avecintc:starting",
379389
avecintc_cpu_online, avecintc_cpu_offline);
380390
#endif
381-
value = iocsr_read64(LOONGARCH_IOCSR_MISC_FUNC);
382-
value |= IOCSR_MISC_FUNC_AVEC_EN;
383-
iocsr_write64(value, LOONGARCH_IOCSR_MISC_FUNC);
391+
avecintc_enable();
384392

385393
return ret;
386394

0 commit comments

Comments
 (0)