Commit bc72ea05 authored by Tianyang Zhang's avatar Tianyang Zhang Committed by Hongchen Zhang
Browse files

irqchip/avec: Support AVEC for 3C6000 multi-node machine

LoongArch inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IB8166


CVE: NA

--------------------------------

This patch enables AVEC functionality for 3C6000 multi-node machine.

The topology of the advanced interrupt controller is consistent with
NUMA node.
We check the enable status of the node where each CPU is located once
when it goes online, which may cause some additional operations, but
it can ensure that the advanced interrupt controller can still be used
in situations where some CPUs cannot start.

In addition, this patch alse fix a bug that use ipi method to
clean expired affinity on multiple nodes.

Signed-off-by: default avatarTianyang Zhang <zhangtianyang@loongson.cn>
parent 429a1987
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ static void avecintc_sync(struct avecintc_data *adata)
		plist = per_cpu_ptr(&pending_list, adata->prev_cpu);
		list_add_tail(&adata->entry, &plist->head);
		adata->moving = 1;
		smp_ops.send_ipi_single(adata->prev_cpu, SMP_CLEAR_VECTOR);
		smp_ops.send_ipi_single(adata->prev_cpu, ACTION_CLEAR_VECTOR);
	}
}

@@ -132,6 +132,7 @@ static int avecintc_set_affinity(struct irq_data *data, const struct cpumask *de

static int avecintc_cpu_online(unsigned int cpu)
{
	long value;
	if (!loongarch_avec.vector_matrix)
		return 0;

@@ -141,6 +142,10 @@ static int avecintc_cpu_online(unsigned int cpu)

	pending_list_init(cpu);

	value = iocsr_read64(LOONGARCH_IOCSR_MISC_FUNC);
	value |= IOCSR_MISC_FUNC_AVEC_EN;
	iocsr_write64(value, LOONGARCH_IOCSR_MISC_FUNC);

	raw_spin_unlock(&loongarch_avec.lock);

	return 0;
@@ -193,7 +198,7 @@ void complete_irq_moving(void)
		}

		if (isr & (1UL << (vector % VECTORS_PER_REG))) {
			smp_ops.send_ipi_single(cpu, SMP_CLEAR_VECTOR);
			smp_ops.send_ipi_single(cpu, ACTION_CLEAR_VECTOR);
			continue;
		}
		list_del(&adata->entry);