diff options
author | Anton Blanchard <anton@samba.org> | 2013-12-11 23:59:36 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-12-12 23:48:34 -0500 |
commit | f8a1883a833bbad8e6b5ec4f0918b7797e652d65 (patch) | |
tree | 7f16fd63cc9ffd6fc218143c244e64265b2a475a | |
parent | 01666c8ee2b6afcd31de2064fbb7c097a75e5089 (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.c | 4 |
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) | |||
580 | int cpu_to_core_id(int cpu) | 580 | int 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); |
595 | out: | 595 | out: |
596 | of_node_put(np); | 596 | of_node_put(np); |
597 | return id; | 597 | return id; |