Skip to content

Commit

Permalink
powerpc: Fix topology core_id endian issue on LE builds
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Anton Blanchard authored and Benjamin Herrenschmidt committed Dec 13, 2013
1 parent 01666c8 commit f8a1883
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/powerpc/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle)
int cpu_to_core_id(int cpu)
{
struct device_node *np;
const int *reg;
const __be32 *reg;
int id = -1;

np = of_get_cpu_node(cpu, NULL);
Expand All @@ -591,7 +591,7 @@ int cpu_to_core_id(int cpu)
if (!reg)
goto out;

id = *reg;
id = be32_to_cpup(reg);
out:
of_node_put(np);
return id;
Expand Down

0 comments on commit f8a1883

Please sign in to comment.