aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2013-12-11 23:59:36 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-12-12 23:48:34 -0500
commitf8a1883a833bbad8e6b5ec4f0918b7797e652d65 (patch)
tree7f16fd63cc9ffd6fc218143c244e64265b2a475a
parent01666c8ee2b6afcd31de2064fbb7c097a75e5089 (diff)
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>
-rw-r--r--arch/powerpc/kernel/smp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index a3b64f3bf9a2..c1cf4a1522d9 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -580,7 +580,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle)
580int cpu_to_core_id(int cpu) 580int cpu_to_core_id(int cpu)
581{ 581{
582 struct device_node *np; 582 struct device_node *np;
583 const int *reg; 583 const __be32 *reg;
584 int id = -1; 584 int id = -1;
585 585
586 np = of_get_cpu_node(cpu, NULL); 586 np = of_get_cpu_node(cpu, NULL);
@@ -591,7 +591,7 @@ int cpu_to_core_id(int cpu)
591 if (!reg) 591 if (!reg)
592 goto out; 592 goto out;
593 593
594 id = *reg; 594 id = be32_to_cpup(reg);
595out: 595out:
596 of_node_put(np); 596 of_node_put(np);
597 return id; 597 return id;