Commit e2f7f737 authored by Matt Evans's avatar Matt Evans Committed by Benjamin Herrenschmidt

powerpc/kexec: Add to and tidy debug/comments in machine_kexec64.c

Tidies some typos, KERN_INFO-ise an info msg, and add a debug msg showing
when the final sequence starts.

Also adds a comment to kexec_prepare_cpus_wait() to make note of a possible
problem; the need for kexec to deal with CPUs that failed to originally start
up.
Signed-off-by: default avatarMatt Evans <matt@ozlabs.org>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 2c48a7d6
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <linux/thread_info.h> #include <linux/thread_info.h>
#include <linux/init_task.h> #include <linux/init_task.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/kernel.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/current.h> #include <asm/current.h>
...@@ -184,7 +185,20 @@ static void kexec_prepare_cpus_wait(int wait_state) ...@@ -184,7 +185,20 @@ static void kexec_prepare_cpus_wait(int wait_state)
hw_breakpoint_disable(); hw_breakpoint_disable();
my_cpu = get_cpu(); my_cpu = get_cpu();
/* Make sure each CPU has atleast made it to the state we need */ /* Make sure each CPU has at least made it to the state we need.
*
* FIXME: There is a (slim) chance of a problem if not all of the CPUs
* are correctly onlined. If somehow we start a CPU on boot with RTAS
* start-cpu, but somehow that CPU doesn't write callin_cpu_map[] in
* time, the boot CPU will timeout. If it does eventually execute
* stuff, the secondary will start up (paca[].cpu_start was written) and
* get into a peculiar state. If the platform supports
* smp_ops->take_timebase(), the secondary CPU will probably be spinning
* in there. If not (i.e. pseries), the secondary will continue on and
* try to online itself/idle/etc. If it survives that, we need to find
* these possible-but-not-online-but-should-be CPUs and chaperone them
* into kexec_smp_wait().
*/
for_each_online_cpu(i) { for_each_online_cpu(i) {
if (i == my_cpu) if (i == my_cpu)
continue; continue;
...@@ -192,9 +206,9 @@ static void kexec_prepare_cpus_wait(int wait_state) ...@@ -192,9 +206,9 @@ static void kexec_prepare_cpus_wait(int wait_state)
while (paca[i].kexec_state < wait_state) { while (paca[i].kexec_state < wait_state) {
barrier(); barrier();
if (i != notified) { if (i != notified) {
printk( "kexec: waiting for cpu %d (physical" printk(KERN_INFO "kexec: waiting for cpu %d "
" %d) to enter %i state\n", "(physical %d) to enter %i state\n",
i, paca[i].hw_cpu_id, wait_state); i, paca[i].hw_cpu_id, wait_state);
notified = i; notified = i;
} }
} }
...@@ -218,7 +232,10 @@ static void kexec_prepare_cpus(void) ...@@ -218,7 +232,10 @@ static void kexec_prepare_cpus(void)
if (ppc_md.kexec_cpu_down) if (ppc_md.kexec_cpu_down)
ppc_md.kexec_cpu_down(0, 0); ppc_md.kexec_cpu_down(0, 0);
/* Before removing MMU mapings make sure all CPUs have entered real mode */ /*
* Before removing MMU mappings make sure all CPUs have entered real
* mode:
*/
kexec_prepare_cpus_wait(KEXEC_STATE_REAL_MODE); kexec_prepare_cpus_wait(KEXEC_STATE_REAL_MODE);
put_cpu(); put_cpu();
...@@ -287,6 +304,8 @@ void default_machine_kexec(struct kimage *image) ...@@ -287,6 +304,8 @@ void default_machine_kexec(struct kimage *image)
if (crashing_cpu == -1) if (crashing_cpu == -1)
kexec_prepare_cpus(); kexec_prepare_cpus();
pr_debug("kexec: Starting switchover sequence.\n");
/* switch to a staticly allocated stack. Based on irq stack code. /* switch to a staticly allocated stack. Based on irq stack code.
* XXX: the task struct will likely be invalid once we do the copy! * XXX: the task struct will likely be invalid once we do the copy!
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment