Skip to contentSkip to conversation

Fix OS_INIT handle in IA64 Kexec/Kdump

PATCH New Zou Nan hai 1 participant 1 message Sep 29, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix OS_INIT handle in IA64 Kexec/Kdump

Hi,
Indoh found the bug of OS_INIT handler in my previous IA64 Kexec/Kdump
patch.
When Kdump found it can't stop other CPUs by IPI, it will send INIT to
them. One of the CPUs may be picked as monarch then execute machine_kexec, thus 2 CPU will execute
machine_kexec at the same time. Below patch will fix that.

arch/ia64/kernel/crash.c +7 -1
@@ -110,6 +110,8 @@ kdump_wait_cpu_freeze(void)
 	return 1;
 }
 
+static int kdump_sending_init;
+
 void
 machine_crash_shutdown(struct pt_regs *pt)
 {
@@ -125,8 +127,9 @@ machine_crash_shutdown(struct pt_regs *p
 #ifdef CONFIG_SMP
 	kdump_smp_send_stop();
 	if (kdump_wait_cpu_freeze() && kdump_on_init) 	{
-		kdump_sending_init = 1;
 		//not all cpu response to IPI, send INIT to freeze them
+		kdump_sending_init = 1;
+		mb();
 		kdump_smp_send_init();
 	}
 #endif
@@ -170,6 +173,9 @@ kdump_init_notifier(struct notifier_bloc
 	if (nd->sos->rv_rc = 1)
 		return NOTIFY_DONE;
 
+	if (kdump_sending_init)
+		unw_init_running(kdump_cpu_freeze, NULL);
+
 	switch (val) {
 		case DIE_INIT_MONARCH_ENTER:
 			machine_kdump_on_init();