diff options
author | Matthew McClintock <msm@freescale.com> | 2010-09-16 18:58:25 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2010-10-14 01:52:50 -0400 |
commit | 5d692961633d4ecd1ca07313b75ddf35520a4c28 (patch) | |
tree | 4e6bbfc62a42441fa9953edbdc71500dc9fbbbde /arch/powerpc/platforms/85xx/smp.c | |
parent | edb85800101c354a395ecc5ed3b52a9499bd4cfc (diff) |
powerpc/85xx: Minor fixups for kexec on 85xx
Make kexec_down_cpus atmoic since it will be incremented by all cores as
they are coming down.
Remove duplicate calls to mpc85xx_smp_kexec_down, now it's called by the
crash and normal kexec pathway only once.
Increase the timeout to wait for other cores to shutdown.
Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/85xx/smp.c')
-rw-r--r-- | arch/powerpc/platforms/85xx/smp.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c index 2aee4b39131..c9a77fa6274 100644 --- a/arch/powerpc/platforms/85xx/smp.c +++ b/arch/powerpc/platforms/85xx/smp.c | |||
@@ -121,17 +121,15 @@ struct smp_ops_t smp_85xx_ops = { | |||
121 | }; | 121 | }; |
122 | 122 | ||
123 | #ifdef CONFIG_KEXEC | 123 | #ifdef CONFIG_KEXEC |
124 | static int kexec_down_cpus = 0; | 124 | atomic_t kexec_down_cpus = ATOMIC_INIT(0); |
125 | 125 | ||
126 | void mpc85xx_smp_kexec_cpu_down(int crash_shutdown, int secondary) | 126 | void mpc85xx_smp_kexec_cpu_down(int crash_shutdown, int secondary) |
127 | { | 127 | { |
128 | /* When crashing, this gets called on all CPU's we only | 128 | local_irq_disable(); |
129 | * take down the non-boot cpus */ | ||
130 | if (smp_processor_id() != boot_cpuid) | ||
131 | { | ||
132 | local_irq_disable(); | ||
133 | kexec_down_cpus++; | ||
134 | 129 | ||
130 | if (secondary) { | ||
131 | atomic_inc(&kexec_down_cpus); | ||
132 | /* loop forever */ | ||
135 | while (1); | 133 | while (1); |
136 | } | 134 | } |
137 | } | 135 | } |
@@ -144,14 +142,14 @@ static void mpc85xx_smp_kexec_down(void *arg) | |||
144 | 142 | ||
145 | static void mpc85xx_smp_machine_kexec(struct kimage *image) | 143 | static void mpc85xx_smp_machine_kexec(struct kimage *image) |
146 | { | 144 | { |
147 | int timeout = 2000; | 145 | int timeout = INT_MAX; |
148 | int i; | 146 | int i, num_cpus = num_present_cpus(); |
149 | 147 | ||
150 | set_cpus_allowed(current, cpumask_of_cpu(boot_cpuid)); | ||
151 | 148 | ||
152 | smp_call_function(mpc85xx_smp_kexec_down, NULL, 0); | 149 | if (image->type == KEXEC_TYPE_DEFAULT) |
150 | smp_call_function(mpc85xx_smp_kexec_down, NULL, 0); | ||
153 | 151 | ||
154 | while ( (kexec_down_cpus != (num_online_cpus() - 1)) && | 152 | while ( (atomic_read(&kexec_down_cpus) != (num_cpus - 1)) && |
155 | ( timeout > 0 ) ) | 153 | ( timeout > 0 ) ) |
156 | { | 154 | { |
157 | timeout--; | 155 | timeout--; |
@@ -160,7 +158,7 @@ static void mpc85xx_smp_machine_kexec(struct kimage *image) | |||
160 | if ( !timeout ) | 158 | if ( !timeout ) |
161 | printk(KERN_ERR "Unable to bring down secondary cpu(s)"); | 159 | printk(KERN_ERR "Unable to bring down secondary cpu(s)"); |
162 | 160 | ||
163 | for (i = 0; i < num_present_cpus(); i++) | 161 | for (i = 0; i < num_cpus; i++) |
164 | { | 162 | { |
165 | if ( i == smp_processor_id() ) continue; | 163 | if ( i == smp_processor_id() ) continue; |
166 | mpic_reset_core(i); | 164 | mpic_reset_core(i); |