Commit 822e7122 authored by Thomas Falcon's avatar Thomas Falcon Committed by Michael Ellerman

pseries: Fix endian issues in onlining cpu threads

The ibm,ppc-interrupt-server#s property is in big endian format.
These values need to be converted when used by little endian
architectures.
Signed-off-by: default avatarThomas Falcon <tlfalcon@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent fe921c8c
...@@ -364,7 +364,8 @@ static int dlpar_online_cpu(struct device_node *dn) ...@@ -364,7 +364,8 @@ static int dlpar_online_cpu(struct device_node *dn)
int rc = 0; int rc = 0;
unsigned int cpu; unsigned int cpu;
int len, nthreads, i; int len, nthreads, i;
const u32 *intserv; const __be32 *intserv;
u32 thread;
intserv = of_get_property(dn, "ibm,ppc-interrupt-server#s", &len); intserv = of_get_property(dn, "ibm,ppc-interrupt-server#s", &len);
if (!intserv) if (!intserv)
...@@ -374,8 +375,9 @@ static int dlpar_online_cpu(struct device_node *dn) ...@@ -374,8 +375,9 @@ static int dlpar_online_cpu(struct device_node *dn)
cpu_maps_update_begin(); cpu_maps_update_begin();
for (i = 0; i < nthreads; i++) { for (i = 0; i < nthreads; i++) {
thread = be32_to_cpu(intserv[i]);
for_each_present_cpu(cpu) { for_each_present_cpu(cpu) {
if (get_hard_smp_processor_id(cpu) != intserv[i]) if (get_hard_smp_processor_id(cpu) != thread)
continue; continue;
BUG_ON(get_cpu_current_state(cpu) BUG_ON(get_cpu_current_state(cpu)
!= CPU_STATE_OFFLINE); != CPU_STATE_OFFLINE);
...@@ -389,7 +391,7 @@ static int dlpar_online_cpu(struct device_node *dn) ...@@ -389,7 +391,7 @@ static int dlpar_online_cpu(struct device_node *dn)
} }
if (cpu == num_possible_cpus()) if (cpu == num_possible_cpus())
printk(KERN_WARNING "Could not find cpu to online " printk(KERN_WARNING "Could not find cpu to online "
"with physical id 0x%x\n", intserv[i]); "with physical id 0x%x\n", thread);
} }
cpu_maps_update_done(); cpu_maps_update_done();
......
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