s390/smp: fix cpu re-scan vs. cpu state
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 15 May 2013 14:53:07 +0000 (16:53 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 17 May 2013 09:47:01 +0000 (11:47 +0200)
The cpu-info array starts with a list of cpus in configured state,
followed by the cpus in standby state. The comparison to decide which
state a cpu has is incorrect, this causes configured cpus appear as
standby cpus. The correct comparison is the index of the new cpu in
the cpu-info array vs. the number of configured cpus.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/kernel/smp.c

index 8074cb4b7cbf9ea7988160131cf2481241a5115b..05674b6690019012f3acdbb86ea5325616df9f76 100644 (file)
@@ -645,7 +645,7 @@ static int __cpuinit __smp_rescan_cpus(struct sclp_cpu_info *info,
                        continue;
                pcpu = pcpu_devices + cpu;
                pcpu->address = info->cpu[i].address;
-               pcpu->state = (cpu >= info->configured) ?
+               pcpu->state = (i >= info->configured) ?
                        CPU_STATE_STANDBY : CPU_STATE_CONFIGURED;
                smp_cpu_set_polarization(cpu, POLARIZATION_UNKNOWN);
                set_cpu_present(cpu, true);