]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
MIPS: Loongson: Make cpumask_of_node() robust against NUMA_NO_NODE
authorJohn Garry <john.g.garry@oracle.com>
Wed, 7 Jan 2026 09:40:06 +0000 (09:40 +0000)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Fri, 30 Jan 2026 14:26:45 +0000 (15:26 +0100)
The arch definition of cpumask_of_node() cannot handle NUMA_NO_NODE - which
is a valid index - so add a check for this.

Signed-off-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/include/asm/mach-loongson64/topology.h

index 3414a1fd17835efc3894d36a8c05e09054bc8a44..89bb4deab98a676e74c7495c647849f0428e1df9 100644 (file)
@@ -7,7 +7,7 @@
 #define cpu_to_node(cpu)       (cpu_logical_map(cpu) >> 2)
 
 extern cpumask_t __node_cpumask[];
-#define cpumask_of_node(node)  (&__node_cpumask[node])
+#define cpumask_of_node(node)    ((node) == NUMA_NO_NODE ? cpu_all_mask : &__node_cpumask[node])
 
 struct pci_bus;
 extern int pcibus_to_node(struct pci_bus *);