summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Evans <matt@ozlabs.org>2010-06-07 21:38:18 +0000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-06-15 15:02:33 +1000
commitb636f1379eefe6eba931deaa386605bc7ac623e7 (patch)
tree482289c45853b5f86f264dd8f98b0f70c94fa4d5
parent65cf840ff4b63852d34d577d559978ccfc554a6c (diff)
downloadblackbird-op-linux-b636f1379eefe6eba931deaa386605bc7ac623e7.tar.gz
blackbird-op-linux-b636f1379eefe6eba931deaa386605bc7ac623e7.zip
powerpc/kexec: Wait for online/possible CPUs only.
kexec_perpare_cpus_wait() iterates i through NR_CPUS to check paca[i].kexec_state of each to make sure they have quiesced. However now we have dynamic PACA allocation, paca[NR_CPUS] is not necessarily valid and we overrun the array; spurious "cpu is not possible, ignoring" errors result. This patch iterates for_each_online_cpu so stays within the bounds of paca[] -- and every CPU is now 'possible'. Signed-off-by: Matt Evans <matt@ozlabs.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--arch/powerpc/kernel/machine_kexec_64.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c
index 26f9900f773c..ed31a29c4ff7 100644
--- a/arch/powerpc/kernel/machine_kexec_64.c
+++ b/arch/powerpc/kernel/machine_kexec_64.c
@@ -182,28 +182,12 @@ static void kexec_prepare_cpus_wait(int wait_state)
my_cpu = get_cpu();
/* Make sure each CPU has atleast made it to the state we need */
- for (i=0; i < NR_CPUS; i++) {
+ for_each_online_cpu(i) {
if (i == my_cpu)
continue;
while (paca[i].kexec_state < wait_state) {
barrier();
- if (!cpu_possible(i)) {
- printk("kexec: cpu %d hw_cpu_id %d is not"
- " possible, ignoring\n",
- i, paca[i].hw_cpu_id);
- break;
- }
- if (!cpu_online(i)) {
- /* Fixme: this can be spinning in
- * pSeries_secondary_wait with a paca
- * waiting for it to go online.
- */
- printk("kexec: cpu %d hw_cpu_id %d is not"
- " online, ignoring\n",
- i, paca[i].hw_cpu_id);
- break;
- }
if (i != notified) {
printk( "kexec: waiting for cpu %d (physical"
" %d) to enter %i state\n",
OpenPOWER on IntegriCloud