aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/powernv/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/powernv/setup.c')
-rw-r--r--arch/powerpc/platforms/powernv/setup.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c
index 685b3cbe1362..a9a8fa37a555 100644
--- a/arch/powerpc/platforms/powernv/setup.c
+++ b/arch/powerpc/platforms/powernv/setup.c
@@ -187,7 +187,7 @@ static void pnv_kexec_wait_secondaries_down(void)
187 187
188 for_each_online_cpu(i) { 188 for_each_online_cpu(i) {
189 uint8_t status; 189 uint8_t status;
190 int64_t rc; 190 int64_t rc, timeout = 1000;
191 191
192 if (i == my_cpu) 192 if (i == my_cpu)
193 continue; 193 continue;
@@ -204,6 +204,18 @@ static void pnv_kexec_wait_secondaries_down(void)
204 i, paca[i].hw_cpu_id); 204 i, paca[i].hw_cpu_id);
205 notified = i; 205 notified = i;
206 } 206 }
207
208 /*
209 * On crash secondaries might be unreachable or hung,
210 * so timeout if we've waited too long
211 * */
212 mdelay(1);
213 if (timeout-- == 0) {
214 printk(KERN_ERR "kexec: timed out waiting for "
215 "cpu %d (physical %d) to enter OPAL\n",
216 i, paca[i].hw_cpu_id);
217 break;
218 }
207 } 219 }
208 } 220 }
209} 221}
@@ -225,13 +237,6 @@ static void pnv_kexec_cpu_down(int crash_shutdown, int secondary)
225 237
226 /* Return the CPU to OPAL */ 238 /* Return the CPU to OPAL */
227 opal_return_cpu(); 239 opal_return_cpu();
228 } else if (crash_shutdown) {
229 /*
230 * On crash, we don't wait for secondaries to go
231 * down as they might be unreachable or hung, so
232 * instead we just wait a bit and move on.
233 */
234 mdelay(1);
235 } else { 240 } else {
236 /* Primary waits for the secondaries to have reached OPAL */ 241 /* Primary waits for the secondaries to have reached OPAL */
237 pnv_kexec_wait_secondaries_down(); 242 pnv_kexec_wait_secondaries_down();