Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64: topology: Initialise default topology state immediately

As a legacy of the way 32 bit ARM did things the topology code uses a null
topology map by default and then overwrites it by mapping cores with no
information to a cluster by themselves later. In order to make it simpler
to reset things as part of recovering from parse failures in firmware
information directly set this configuration on init. A core will always be
its own sibling so there should be no risk of confusion with firmware
provided information.

Signed-off-by: Mark Brown <broonie@linaro.org>
Reviewed-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

authored by

Mark Brown and committed by
Catalin Marinas
c31bf048 5dd349ba

+4 -4
+4 -4
arch/arm64/kernel/topology.c
··· 43 43 * reset it to default behaviour 44 44 */ 45 45 pr_debug("CPU%u: No topology information configured\n", cpuid); 46 - cpuid_topo->core_id = 0; 47 - cpumask_set_cpu(cpuid, &cpuid_topo->core_sibling); 48 - cpumask_set_cpu(cpuid, &cpuid_topo->thread_sibling); 49 46 return; 50 47 } 51 48 ··· 84 87 struct cpu_topology *cpu_topo = &cpu_topology[cpu]; 85 88 86 89 cpu_topo->thread_id = -1; 87 - cpu_topo->core_id = -1; 90 + cpu_topo->core_id = 0; 88 91 cpu_topo->cluster_id = -1; 92 + 89 93 cpumask_clear(&cpu_topo->core_sibling); 94 + cpumask_set_cpu(cpu, &cpu_topo->core_sibling); 90 95 cpumask_clear(&cpu_topo->thread_sibling); 96 + cpumask_set_cpu(cpu, &cpu_topo->thread_sibling); 91 97 } 92 98 }