From: Matthias Urlichs <smurf@smurf.noris.de>

The softlockup code needs to turn itself off when a kernel panic occurs. 
Otherwise, the panic information will scroll off the screen after ten
seconds.

Signed-Off-By: Matthias Urlichs <smurf@smurf.noris.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 kernel/softlockup.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+)

diff -puN kernel/softlockup.c~turn-soft-lock-off-when-panicking kernel/softlockup.c
--- 25/kernel/softlockup.c~turn-soft-lock-off-when-panicking	2005-06-06 00:14:11.000000000 -0700
+++ 25-akpm/kernel/softlockup.c	2005-06-06 00:14:11.000000000 -0700
@@ -20,6 +20,19 @@ static DEFINE_PER_CPU(unsigned long, tim
 static DEFINE_PER_CPU(unsigned long, print_timestamp) = 0;
 static DEFINE_PER_CPU(struct task_struct *, watchdog_task);
 
+static int did_panic = 0;
+static int softlock_panic(struct notifier_block *this, unsigned long event,
+				void *ptr)
+{
+	did_panic = 1;
+
+	return NOTIFY_DONE;
+}
+
+static struct notifier_block panic_block = {
+	.notifier_call = softlock_panic,
+};
+
 void touch_softlockup_watchdog(void)
 {
 	per_cpu(timestamp, raw_smp_processor_id()) = jiffies;
@@ -37,6 +50,10 @@ void softlockup_tick(struct pt_regs *reg
 	if (per_cpu(print_timestamp, this_cpu) == timestamp)
 		return;
 
+	/* Do not cause a second panic when there already was one */
+	if (did_panic)
+		return;
+
 	if (time_after(jiffies, timestamp + 10*HZ)) {
 		per_cpu(print_timestamp, this_cpu) = timestamp;
 
@@ -126,5 +143,7 @@ __init void spawn_softlockup_task(void)
 	cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu);
 	cpu_callback(&cpu_nfb, CPU_ONLINE, cpu);
 	register_cpu_notifier(&cpu_nfb);
+
+	notifier_chain_register(&panic_notifier_list, &panic_block);
 }
 
_