diff options
| author | Anton Blanchard <anton@samba.org> | 2013-12-11 23:59:35 -0500 |
|---|---|---|
| committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-12-12 23:48:34 -0500 |
| commit | 01666c8ee2b6afcd31de2064fbb7c097a75e5089 (patch) | |
| tree | 466b1b8e114dcd7912389f1d165c4b4a38fc768f | |
| parent | 36aa1b180e7398e2bd27642760bfaa4ad8c65ab6 (diff) | |
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: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
| -rw-r--r-- | arch/powerpc/kernel/setup-common.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index febc80445d25..bc76cc6b419c 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c | |||
| @@ -479,7 +479,7 @@ void __init smp_setup_cpu_maps(void) | |||
| 479 | if (machine_is(pseries) && firmware_has_feature(FW_FEATURE_LPAR) && | 479 | if (machine_is(pseries) && firmware_has_feature(FW_FEATURE_LPAR) && |
| 480 | (dn = of_find_node_by_path("/rtas"))) { | 480 | (dn = of_find_node_by_path("/rtas"))) { |
| 481 | int num_addr_cell, num_size_cell, maxcpus; | 481 | int num_addr_cell, num_size_cell, maxcpus; |
| 482 | const unsigned int *ireg; | 482 | const __be32 *ireg; |
| 483 | 483 | ||
| 484 | num_addr_cell = of_n_addr_cells(dn); | 484 | num_addr_cell = of_n_addr_cells(dn); |
| 485 | num_size_cell = of_n_size_cells(dn); | 485 | num_size_cell = of_n_size_cells(dn); |
| @@ -489,7 +489,7 @@ void __init smp_setup_cpu_maps(void) | |||
| 489 | if (!ireg) | 489 | if (!ireg) |
| 490 | goto out; | 490 | goto out; |
| 491 | 491 | ||
| 492 | maxcpus = ireg[num_addr_cell + num_size_cell]; | 492 | maxcpus = be32_to_cpup(ireg + num_addr_cell + num_size_cell); |
| 493 | 493 | ||
| 494 | /* Double maxcpus for processors which have SMT capability */ | 494 | /* Double maxcpus for processors which have SMT capability */ |
| 495 | if (cpu_has_feature(CPU_FTR_SMT)) | 495 | if (cpu_has_feature(CPU_FTR_SMT)) |
