Commit 01666c8e authored by Anton Blanchard's avatar Anton Blanchard Committed by Benjamin Herrenschmidt

powerpc: Fix endian issue in setup-common.c

During on LE boot we see:

    Partition configured for 1073741824 cpus, operating system maximum is 2048.

Clearly missing a byteswap here.
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 36aa1b18
...@@ -479,7 +479,7 @@ void __init smp_setup_cpu_maps(void) ...@@ -479,7 +479,7 @@ void __init smp_setup_cpu_maps(void)
if (machine_is(pseries) && firmware_has_feature(FW_FEATURE_LPAR) && if (machine_is(pseries) && firmware_has_feature(FW_FEATURE_LPAR) &&
(dn = of_find_node_by_path("/rtas"))) { (dn = of_find_node_by_path("/rtas"))) {
int num_addr_cell, num_size_cell, maxcpus; int num_addr_cell, num_size_cell, maxcpus;
const unsigned int *ireg; const __be32 *ireg;
num_addr_cell = of_n_addr_cells(dn); num_addr_cell = of_n_addr_cells(dn);
num_size_cell = of_n_size_cells(dn); num_size_cell = of_n_size_cells(dn);
...@@ -489,7 +489,7 @@ void __init smp_setup_cpu_maps(void) ...@@ -489,7 +489,7 @@ void __init smp_setup_cpu_maps(void)
if (!ireg) if (!ireg)
goto out; goto out;
maxcpus = ireg[num_addr_cell + num_size_cell]; maxcpus = be32_to_cpup(ireg + num_addr_cell + num_size_cell);
/* Double maxcpus for processors which have SMT capability */ /* Double maxcpus for processors which have SMT capability */
if (cpu_has_feature(CPU_FTR_SMT)) if (cpu_has_feature(CPU_FTR_SMT))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment