diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-05-20 03:50:18 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-05-20 03:50:18 -0400 |
commit | 208b3a4c196e733b9cec006dc132cfc149b2810a (patch) | |
tree | 72f0a54c20389b0be3fc2b7d76f2e6d26bd627e2 /arch | |
parent | e83b906c99eb87a11cd731f6726e60cd8ac9ec4b (diff) |
powerpc: Fix hard CPU IDs detection
commit 9d07bc841c9779b4d7902e417f4e509996ce805d
"powerpc: Properly handshake CPUs going out of boot spin loop"
Would cause a miscalculation of the hard CPU ID. It removes breaking
out of the loop when finding a match with a processor, thus the "i"
used as an index in the intserv array is always incorrect
This broke interrupt on my PowerMac laptop.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/kernel/prom.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 5311a26dcf46..48aeb55faae9 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
@@ -278,6 +278,7 @@ static int __init early_init_dt_scan_cpus(unsigned long node, | |||
278 | int i, nthreads; | 278 | int i, nthreads; |
279 | unsigned long len; | 279 | unsigned long len; |
280 | int found = -1; | 280 | int found = -1; |
281 | int found_thread = 0; | ||
281 | 282 | ||
282 | /* We are scanning "cpu" nodes only */ | 283 | /* We are scanning "cpu" nodes only */ |
283 | if (type == NULL || strcmp(type, "cpu") != 0) | 284 | if (type == NULL || strcmp(type, "cpu") != 0) |
@@ -301,9 +302,11 @@ static int __init early_init_dt_scan_cpus(unsigned long node, | |||
301 | * version 2 of the kexec param format adds the phys cpuid of | 302 | * version 2 of the kexec param format adds the phys cpuid of |
302 | * booted proc. | 303 | * booted proc. |
303 | */ | 304 | */ |
304 | if (initial_boot_params && initial_boot_params->version >= 2) { | 305 | if (initial_boot_params->version >= 2) { |
305 | if (intserv[i] == initial_boot_params->boot_cpuid_phys) | 306 | if (intserv[i] == initial_boot_params->boot_cpuid_phys) { |
306 | found = boot_cpu_count; | 307 | found = boot_cpu_count; |
308 | found_thread = i; | ||
309 | } | ||
307 | } else { | 310 | } else { |
308 | /* | 311 | /* |
309 | * Check if it's the boot-cpu, set it's hw index now, | 312 | * Check if it's the boot-cpu, set it's hw index now, |
@@ -322,9 +325,9 @@ static int __init early_init_dt_scan_cpus(unsigned long node, | |||
322 | 325 | ||
323 | if (found >= 0) { | 326 | if (found >= 0) { |
324 | DBG("boot cpu: logical %d physical %d\n", found, | 327 | DBG("boot cpu: logical %d physical %d\n", found, |
325 | intserv[i]); | 328 | intserv[found_thread]); |
326 | boot_cpuid = found; | 329 | boot_cpuid = found; |
327 | set_hard_smp_processor_id(found, intserv[i]); | 330 | set_hard_smp_processor_id(found, intserv[found_thread]); |
328 | 331 | ||
329 | /* | 332 | /* |
330 | * PAPR defines "logical" PVR values for cpus that | 333 | * PAPR defines "logical" PVR values for cpus that |