Skip to content

Commit 2d64eae

Browse files
chenhuacaiKAGA-KOKO
authored andcommitted
irqchip/loongson-eiointc: Use early_cpu_to_node() instead of cpu_to_node()
Multi-bridge machines required that all eiointc controllers in the system are initialized, otherwise the system does not boot. The initialization happens on the boot CPU during early boot and relies on cpu_to_node() for identifying the individual nodes. That works when the number of possible CPUs is large enough, but with a command line limit, e.g. "nr_cpus=$N" for kdump, but fails when the CPUs of the secondary nodes are not covered. During early ACPI enumeration all CPU to node mappings are recorded up to CONFIG_NR_CPUS. These are accessible via early_cpu_to_node() even in the case that "nr_cpus=N" truncates the number of possible CPUs and only provides the possible CPUs via cpu_to_node() translation. Change the node lookup in the driver to use early_cpu_to_node() so that even with a limitation on the number of possible CPUs all eointc instances are initialized. This can't obviously cure the case where CONFIG_NR_CPUS is too small. [ tglx: Massaged changelog ] Fixes: 64cc451 ("irqchip/loongson-eiointc: Fix incorrect use of acpi_get_vec_parent") 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/20240623034113.1808727-1-chenhuacai@loongson.cn
1 parent 6ba59ff commit 2d64eae

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/irqchip/irq-loongson-eiointc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <linux/irqchip/chained_irq.h>
1616
#include <linux/kernel.h>
1717
#include <linux/syscore_ops.h>
18+
#include <asm/numa.h>
1819

1920
#define EIOINTC_REG_NODEMAP 0x14a0
2021
#define EIOINTC_REG_IPMAP 0x14c0
@@ -339,7 +340,7 @@ static int __init pch_msi_parse_madt(union acpi_subtable_headers *header,
339340
int node;
340341

341342
if (cpu_has_flatmode)
342-
node = cpu_to_node(eiointc_priv[nr_pics - 1]->node * CORES_PER_EIO_NODE);
343+
node = early_cpu_to_node(eiointc_priv[nr_pics - 1]->node * CORES_PER_EIO_NODE);
343344
else
344345
node = eiointc_priv[nr_pics - 1]->node;
345346

@@ -431,7 +432,7 @@ int __init eiointc_acpi_init(struct irq_domain *parent,
431432
goto out_free_handle;
432433

433434
if (cpu_has_flatmode)
434-
node = cpu_to_node(acpi_eiointc->node * CORES_PER_EIO_NODE);
435+
node = early_cpu_to_node(acpi_eiointc->node * CORES_PER_EIO_NODE);
435436
else
436437
node = acpi_eiointc->node;
437438
acpi_set_vec_parent(node, priv->eiointc_domain, pch_group);

0 commit comments

Comments
 (0)