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

powerpc: Fix topology core_id endian issue on LE builds

cpu_to_core_id() is missing a byteswap:

cat /sys/devices/system/cpu/cpu63/topology/core_id
201326592

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

Anton Blanchard and committed by
Benjamin Herrenschmidt
f8a1883a 01666c8e

+2 -2
+2 -2
arch/powerpc/kernel/smp.c
··· 580 580 int cpu_to_core_id(int cpu) 581 581 { 582 582 struct device_node *np; 583 - const int *reg; 583 + const __be32 *reg; 584 584 int id = -1; 585 585 586 586 np = of_get_cpu_node(cpu, NULL); ··· 591 591 if (!reg) 592 592 goto out; 593 593 594 - id = *reg; 594 + id = be32_to_cpup(reg); 595 595 out: 596 596 of_node_put(np); 597 597 return id;