summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/prom.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-05-20 09:50:18 +0200
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-05-20 09:50:18 +0200
commit208b3a4c196e733b9cec006dc132cfc149b2810a (patch)
tree72f0a54c20389b0be3fc2b7d76f2e6d26bd627e2 /arch/powerpc/kernel/prom.c
parentpowerpc/pmac: Update via-pmu to new syscore_ops (diff)
downloadlinux-208b3a4c196e733b9cec006dc132cfc149b2810a.tar.xz
linux-208b3a4c196e733b9cec006dc132cfc149b2810a.zip
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 '')
-rw-r--r--arch/powerpc/kernel/prom.c11
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,
int i, nthreads;
unsigned long len;
int found = -1;
+ int found_thread = 0;
/* We are scanning "cpu" nodes only */
if (type == NULL || strcmp(type, "cpu") != 0)
@@ -301,9 +302,11 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
* version 2 of the kexec param format adds the phys cpuid of
* booted proc.
*/
- if (initial_boot_params && initial_boot_params->version >= 2) {
- if (intserv[i] == initial_boot_params->boot_cpuid_phys)
+ if (initial_boot_params->version >= 2) {
+ if (intserv[i] == initial_boot_params->boot_cpuid_phys) {
found = boot_cpu_count;
+ found_thread = i;
+ }
} else {
/*
* 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,
if (found >= 0) {
DBG("boot cpu: logical %d physical %d\n", found,
- intserv[i]);
+ intserv[found_thread]);
boot_cpuid = found;
- set_hard_smp_processor_id(found, intserv[i]);
+ set_hard_smp_processor_id(found, intserv[found_thread]);
/*
* PAPR defines "logical" PVR values for cpus that