Patchwork hang on panic, can not return to OBP

login
register
mail settings
Submitter Meelis Roos
Date Feb. 5, 2009, 2:07 p.m.
Message ID <Pine.SOC.4.64.0902051204550.17957@math.ut.ee>
Download mbox | patch
Permalink /patch/22112/
State RFC
Delegated to: David Miller
Headers show

Comments

Meelis Roos - Feb. 5, 2009, 2:07 p.m.
Hello,

I started to debug my latest problem with Quad HME. First there is a 
OF mapping problem, then on quad also a IRQ problem, these I did not 
touch. Then came prontk recursion problem that caused panic, this I did 
not touch yet. The panic told I cpuld return to PROM with Stop-A but I 
couldn't, and this was the problem I tried to solve.

First, why tell the user to press Stop-A or break at all? Is it because 
we can extract information from Break-T, Break-P etc? Otherwise the 
panic code could drop to prom itself?

I tried the following patch and that did not work - probably because of 
the same reason that Break did not work (interrupts off?). Seems the 
local_irq_enable() is not enough - but what could help here? Is 
prom_halt() the right thing? ... Kad a look of waht Stop-A does, tried 
also the second patch... but if it would have worked, Stop-A wouldb 
prpbaly also have.

This patch is of course not even close to merging, it's just a hack to 
try it out.
David Miller - Feb. 6, 2009, 8:55 a.m.
From: Meelis Roos <mroos@linux.ee>
Date: Thu, 5 Feb 2009 16:07:14 +0200 (EET)

> First, why tell the user to press Stop-A or break at all? Is it because 
> we can extract information from Break-T, Break-P etc? Otherwise the 
> panic code could drop to prom itself?

You might want to hit SysRQ-something to extract information,
remount root read-only, unmount all partitions, force another
sync, etc. before dropping to the prom.

> I tried the following patch and that did not work - probably because of 
> the same reason that Break did not work (interrupts off?). Seems the 
> local_irq_enable() is not enough - but what could help here? Is 
> prom_halt() the right thing? ... Kad a look of waht Stop-A does, tried 
> also the second patch... but if it would have worked, Stop-A wouldb 
> prpbaly also have.
> 
> This patch is of course not even close to merging, it's just a hack to 
> try it out.

What kind of console are you on?

For serial consoles, you have to send BREAK twice.

For traditional type4/5 serial keyboards, Stop-A should work.

For USB keyboard nothing is going to work, sorry.

PROM console will also not work for fetching input and
breaking into the firmware.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Meelis Roos - Feb. 6, 2009, 12:38 p.m.
> What kind of console are you on?
> 
> For serial consoles, you have to send BREAK twice.

I'm on serial console:
[  129.237799] f005de3c: ttyS0 at MMIO 0x1fff8902000 (irq = 2) is a zs (ESCC)
[  129.237925] Console: ttyS0 (SunZilog zs0)
[  129.238289] console [ttyS0] enabled

Strange that this time (fresh todays git kernel with no changes) I can 
use BREAK successfully - and I only need to send it once from minicom 
(^A F).
David Miller - Feb. 6, 2009, 10:14 p.m.
From: Meelis Roos <mroos@linux.ee>
Date: Fri, 6 Feb 2009 14:38:25 +0200 (EET)

> > What kind of console are you on?
> > 
> > For serial consoles, you have to send BREAK twice.
> 
> I'm on serial console:
> [  129.237799] f005de3c: ttyS0 at MMIO 0x1fff8902000 (irq = 2) is a zs (ESCC)
> [  129.237925] Console: ttyS0 (SunZilog zs0)
> [  129.238289] console [ttyS0] enabled
> 
> Strange that this time (fresh todays git kernel with no changes) I can 
> use BREAK successfully - and I only need to send it once from minicom 
> (^A F).

Strange...  I have to send two breaks on hypervisor sun4v consoles.

Because the way you send Alt-SYSRQ keycodes on serial consoles
is BREAK+sysrq_code, and that's why two breaks are necessary to
indicate a real break into the OBP prompt.

I suspect it doesn't work for you in that other case because it's
at a point before the serial driver has even registered yet.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Meelis Roos - Feb. 7, 2009, 8:44 a.m.
> > I'm on serial console:
> > [  129.237799] f005de3c: ttyS0 at MMIO 0x1fff8902000 (irq = 2) is a zs (ESCC)
> > [  129.237925] Console: ttyS0 (SunZilog zs0)
> > [  129.238289] console [ttyS0] enabled
> > 
> > Strange that this time (fresh todays git kernel with no changes) I can 
> > use BREAK successfully - and I only need to send it once from minicom 
> > (^A F).
> 
> Strange...  I have to send two breaks on hypervisor sun4v consoles.
> 
> Because the way you send Alt-SYSRQ keycodes on serial consoles
> is BREAK+sysrq_code, and that's why two breaks are necessary to
> indicate a real break into the OBP prompt.
> 
> I suspect it doesn't work for you in that other case because it's
> at a point before the serial driver has even registered yet.

I think it was registered...

Just tried with fully booted up system (E3500, console on zs serial) and 
single BREAK was enough to drop to prom ok prompt.

Patch

diff --git a/kernel/panic.c b/kernel/panic.c
index 2a2ff36..ffe6f2a 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -22,6 +22,9 @@ 
 #include <linux/random.h>
 #include <linux/kallsyms.h>
 #include <linux/dmi.h>
+#ifdef __sparc__
+#include <asm/oplib.h>
+#endif
 
 int panic_on_oops;
 static unsigned long tainted_mask;
@@ -120,13 +123,16 @@  NORET_TYPE void panic(const char * fmt, ...)
 		extern int stop_a_enabled;
 		/* Make sure the user can actually press Stop-A (L1-A) */
 		stop_a_enabled = 1;
-		printk(KERN_EMERG "Press Stop-A (L1-A) to return to the boot prom\n");
+		printk(KERN_EMERG "Returning to the boot prom\n");
 	}
 #endif
 #if defined(CONFIG_S390)
 	disabled_wait(caller);
 #endif
 	local_irq_enable();
+#ifdef __sparc__
+	prom_halt();
+#endif
 	for (i = 0;;) {
 		touch_softlockup_watchdog();
 		i += panic_blink(i);


And the other one:

diff --git a/kernel/panic.c b/kernel/panic.c
index 2a2ff36..df46a5c 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -22,6 +22,9 @@ 
 #include <linux/random.h>
 #include <linux/kallsyms.h>
 #include <linux/dmi.h>
+#ifdef __sparc__
+#include <asm/oplib.h>
+#endif
 
 int panic_on_oops;
 static unsigned long tainted_mask;
@@ -120,13 +123,19 @@  NORET_TYPE void panic(const char * fmt, ...)
 		extern int stop_a_enabled;
 		/* Make sure the user can actually press Stop-A (L1-A) */
 		stop_a_enabled = 1;
-		printk(KERN_EMERG "Press Stop-A (L1-A) to return to the boot prom\n");
+		printk(KERN_EMERG "Returning to the boot prom\n");
 	}
 #endif
 #if defined(CONFIG_S390)
 	disabled_wait(caller);
 #endif
 	local_irq_enable();
+#ifdef __sparc__
+	prom_printf("\n");
+	flush_user_windows();
+
+	prom_cmdline();
+#endif
 	for (i = 0;;) {
 		touch_softlockup_watchdog();
 		i += panic_blink(i);