* [PATCH] return to OF via trap, not exit
@ 2006-03-04 19:10 Olaf Hering
2006-03-06 1:12 ` Michael Ellerman
0 siblings, 1 reply; 11+ messages in thread
From: Olaf Hering @ 2006-03-04 19:10 UTC (permalink / raw)
To: Paul Mackeras, linuxppc-dev
Do not call prom exit prom_panic. It clears the screen and the exit message is lost.
On some (or all?) pmacs it causes another crash when OF tries to print the
date and time in its banner.
Signed-off-by: Olaf Hering <olh@suse.de>
arch/powerpc/kernel/prom_init.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletion(-)
Index: linux-2.6.16-rc5-olh/arch/powerpc/kernel/prom_init.c
===================================================================
--- linux-2.6.16-rc5-olh.orig/arch/powerpc/kernel/prom_init.c
+++ linux-2.6.16-rc5-olh/arch/powerpc/kernel/prom_init.c
@@ -398,7 +398,9 @@ static void __init __attribute__((noretu
#endif
prom_print(reason);
/* ToDo: should put up an SRC here on p/iSeries */
- call_prom("exit", 0, 0);
+ /* Do not call exit because it clears the screen on pmac
+ * it also causes some sort of double-fault on early pmacs */
+ asm("trap\n");
for (;;) /* should never get here */
;
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH] return to OF via trap, not exit 2006-03-04 19:10 [PATCH] return to OF via trap, not exit Olaf Hering @ 2006-03-06 1:12 ` Michael Ellerman 2006-03-06 7:38 ` Olaf Hering 0 siblings, 1 reply; 11+ messages in thread From: Michael Ellerman @ 2006-03-06 1:12 UTC (permalink / raw) To: linuxppc-dev; +Cc: Olaf Hering [-- Attachment #1: Type: text/plain, Size: 2849 bytes --] On Sun, 5 Mar 2006 06:10, Olaf Hering wrote: > Do not call prom exit prom_panic. It clears the screen and the exit message > is lost. On some (or all?) pmacs it causes another crash when OF tries to > print the date and time in its banner. > > Signed-off-by: Olaf Hering <olh@suse.de> > > arch/powerpc/kernel/prom_init.c | 4 +++- > 1 files changed, 3 insertions(+), 1 deletion(-) > > Index: linux-2.6.16-rc5-olh/arch/powerpc/kernel/prom_init.c > =================================================================== > --- linux-2.6.16-rc5-olh.orig/arch/powerpc/kernel/prom_init.c > +++ linux-2.6.16-rc5-olh/arch/powerpc/kernel/prom_init.c > @@ -398,7 +398,9 @@ static void __init __attribute__((noretu > #endif > prom_print(reason); > /* ToDo: should put up an SRC here on p/iSeries */ > - call_prom("exit", 0, 0); > + /* Do not call exit because it clears the screen on pmac > + * it also causes some sort of double-fault on early pmacs */ > + asm("trap\n"); > > for (;;) /* should never get here */ > ; I don't think I like it, on IBM firmware it takes us from this: Elapsed time since release of system processors: 26005 mins 51 secs zImage starting: loaded at 0x00400000 (sp: 0x01a1ffe0) Allocating 0x7edc50 bytes for kernel ... OF version = 'IBM,SF230_126' gunzipping (0x1c00000 <- 0x407000:0x6a04e4)...done 0x766880 bytes OF stdout device is: /vdevice/vty@30000000 Error: You can't boot a kdump kernel from OF! EXIT called ok 0 > To this: Elapsed time since release of system processors: 25995 mins 56 secs zImage starting: loaded at 0x00400000 (sp: 0x01a1ffe0) Allocating 0x7edc50 bytes for kernel ... OF version = 'IBM,SF230_126' gunzipping (0x1c00000 <- 0x407000:0x6a044b)...done 0x766880 bytes OF stdout device is: /vdevice/vty@30000000 Error: You can't boot a kdump kernel from OF! DEFAULT CATCH!, exception-handler=fff00700 at %SRR0: 00000000020eaf78 %SRR1: 8000000000023002 Open Firmware exception handler entered from non-OF code Client's Fix Pt Regs: 00 00000000020eaf78 0000000001a1fe90 00000000023681d0 0000000000000002 04 0000000044000024 0000000000000000 0000000000000000 0000000002063e1e 08 0000000000000000 0000000001a1fc9c 0000000000003002 0000000000003002 0c 2000000000000000 0000000000000000 0000000000000000 0000000000000000 10 0000000000000000 0000000000000000 0000000000000000 0000000000000000 14 0000000000c00000 0000000000000008 0000000000000000 0000000000000000 18 0000000000000000 0000000000000000 0000000000000000 0000000000c39a48 1c c000000002453cc8 0000000002108938 0000000000000000 fffffffffffffffd Special Regs: %IV: 00000700 %CR: 44000022 %XER: 00000000 %DSISR: 00000000 %SRR0: 00000000020eaf78 %SRR1: 8000000000023002 %LR: 00000000020eaf78 %CTR: 0000000000000000 %DAR: 0000000000000000 Virtual PID = 0 PFW: Unable to send error log! ok 0 > cheers [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] return to OF via trap, not exit 2006-03-06 1:12 ` Michael Ellerman @ 2006-03-06 7:38 ` Olaf Hering 2006-03-06 7:41 ` Segher Boessenkool 0 siblings, 1 reply; 11+ messages in thread From: Olaf Hering @ 2006-03-06 7:38 UTC (permalink / raw) To: Michael Ellerman; +Cc: linuxppc-dev On Mon, Mar 06, Michael Ellerman wrote: > I don't think I like it, on IBM firmware it takes us from this: > > Elapsed time since release of system processors: 26005 mins 51 secs > > zImage starting: loaded at 0x00400000 (sp: 0x01a1ffe0) > Allocating 0x7edc50 bytes for kernel ... > OF version = 'IBM,SF230_126' > gunzipping (0x1c00000 <- 0x407000:0x6a04e4)...done 0x766880 bytes > OF stdout device is: /vdevice/vty@30000000 > Error: You can't boot a kdump kernel from OF! > EXIT called ok > 0 > > > > To this: Which is likely ok because it saves us from typing .registers manually. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] return to OF via trap, not exit 2006-03-06 7:38 ` Olaf Hering @ 2006-03-06 7:41 ` Segher Boessenkool 2006-03-06 7:43 ` Olaf Hering 0 siblings, 1 reply; 11+ messages in thread From: Segher Boessenkool @ 2006-03-06 7:41 UTC (permalink / raw) To: Olaf Hering; +Cc: Michael Ellerman, linuxppc-dev > Which is likely ok because it saves us from typing .registers > manually. I can't say that's a great argument. How about doing the trap thing on "known-bad" platforms only? Segher ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] return to OF via trap, not exit 2006-03-06 7:41 ` Segher Boessenkool @ 2006-03-06 7:43 ` Olaf Hering 2006-03-06 7:46 ` Segher Boessenkool 0 siblings, 1 reply; 11+ messages in thread From: Olaf Hering @ 2006-03-06 7:43 UTC (permalink / raw) To: Segher Boessenkool; +Cc: Michael Ellerman, linuxppc-dev On Mon, Mar 06, Segher Boessenkool wrote: > >Which is likely ok because it saves us from typing .registers > >manually. > > I can't say that's a great argument. How about doing the trap thing > on "known-bad" platforms only? Can you do anything at that time anyway? I mean, reset-all pending either way. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] return to OF via trap, not exit 2006-03-06 7:43 ` Olaf Hering @ 2006-03-06 7:46 ` Segher Boessenkool 2006-03-06 7:49 ` Olaf Hering 0 siblings, 1 reply; 11+ messages in thread From: Segher Boessenkool @ 2006-03-06 7:46 UTC (permalink / raw) To: Olaf Hering; +Cc: Michael Ellerman, linuxppc-dev >>> Which is likely ok because it saves us from typing .registers >>> manually. >> >> I can't say that's a great argument. How about doing the trap thing >> on "known-bad" platforms only? > > Can you do anything at that time anyway? I mean, reset-all pending > either way. You can boot a different kernel, or try to work out what went wrong. Segher ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] return to OF via trap, not exit 2006-03-06 7:46 ` Segher Boessenkool @ 2006-03-06 7:49 ` Olaf Hering 2006-03-06 7:57 ` Segher Boessenkool 0 siblings, 1 reply; 11+ messages in thread From: Olaf Hering @ 2006-03-06 7:49 UTC (permalink / raw) To: Segher Boessenkool; +Cc: Michael Ellerman, linuxppc-dev On Mon, Mar 06, Segher Boessenkool wrote: > >>> Which is likely ok because it saves us from typing .registers > >>> manually. > >> > >> I can't say that's a great argument. How about doing the trap thing > >> on "known-bad" platforms only? > > > > Can you do anything at that time anyway? I mean, reset-all pending > > either way. > > You can boot a different kernel, or try to work out what went wrong. No, I cant, all resources are possible busy. Either way, maybe checking what type stdout is and trap or exit depending on that. And I dont see whats bad about 'trap handler called', other than being verbose. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] return to OF via trap, not exit 2006-03-06 7:49 ` Olaf Hering @ 2006-03-06 7:57 ` Segher Boessenkool 2006-03-23 21:03 ` Olaf Hering 0 siblings, 1 reply; 11+ messages in thread From: Segher Boessenkool @ 2006-03-06 7:57 UTC (permalink / raw) To: Olaf Hering; +Cc: Michael Ellerman, linuxppc-dev >>> Can you do anything at that time anyway? I mean, reset-all pending >>> either way. >> >> You can boot a different kernel, or try to work out what went wrong. > > No, I cant, all resources are possible busy. That's a separate bug. What resources do you see busy? Allocated memory, I/O devices? > Either way, maybe checking > what type stdout is and trap or exit depending on that. That's better than always calling trap, sure. Is there any reason you can't just do it on Macs though? Because the problem you're trying to work around only happens there. > And I dont see whats bad about 'trap handler called', other than being > verbose. Too verbose -- it prints useless information, and the actual error message might scroll away. No biggie of course, but why do the workaround when not needed? Segher ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] return to OF via trap, not exit 2006-03-06 7:57 ` Segher Boessenkool @ 2006-03-23 21:03 ` Olaf Hering 2006-03-23 23:11 ` Michael Ellerman 2006-03-24 12:13 ` Segher Boessenkool 0 siblings, 2 replies; 11+ messages in thread From: Olaf Hering @ 2006-03-23 21:03 UTC (permalink / raw) To: Segher Boessenkool; +Cc: Michael Ellerman, linuxppc-dev On Mon, Mar 06, Segher Boessenkool wrote: > That's better than always calling trap, sure. Is there any reason > you can't just do it on Macs though? Because the problem you're trying > to work around only happens there. Maybe something like this? Only compile tested Do not call prom exit prom_panic. It clears the screen and the exit message is lost. On some (or all?) pmacs it causes another crash when OF tries to print the date and time in its banner. Set of_platform earlier to catch more prom_panic() calls. Signed-off-by: Olaf Hering <olh@suse.de> arch/powerpc/kernel/prom_init.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) Index: linux-2.6.16-olh/arch/powerpc/kernel/prom_init.c =================================================================== --- linux-2.6.16-olh.orig/arch/powerpc/kernel/prom_init.c +++ linux-2.6.16-olh/arch/powerpc/kernel/prom_init.c @@ -397,6 +397,11 @@ static void __init __attribute__((noretu reason = PTRRELOC(reason); #endif prom_print(reason); + /* Do not call exit because it clears the screen on pmac + * it also causes some sort of double-fault on early pmacs */ + if (RELOC(of_platform) == PLATFORM_POWERMAC) + asm("trap\n"); + /* ToDo: should put up an SRC here on p/iSeries */ call_prom("exit", 0, 0); @@ -2060,15 +2065,6 @@ unsigned long __init prom_init(unsigned */ prom_init_stdout(); - /* Bail if this is a kdump kernel. */ - if (PHYSICAL_START > 0) - prom_panic("Error: You can't boot a kdump kernel from OF!\n"); - - /* - * Check for an initrd - */ - prom_check_initrd(r3, r4); - /* * Get default machine type. At this point, we do not differentiate * between pSeries SMP and pSeries LPAR @@ -2078,6 +2074,15 @@ unsigned long __init prom_init(unsigned prom_setprop(_prom->chosen, "/chosen", "linux,platform", &getprop_rval, sizeof(getprop_rval)); + /* Bail if this is a kdump kernel. */ + if (PHYSICAL_START > 0) + prom_panic("Error: You can't boot a kdump kernel from OF!\n"); + + /* + * Check for an initrd + */ + prom_check_initrd(r3, r4); + #ifdef CONFIG_PPC_PSERIES /* * On pSeries, inform the firmware about our capabilities ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] return to OF via trap, not exit 2006-03-23 21:03 ` Olaf Hering @ 2006-03-23 23:11 ` Michael Ellerman 2006-03-24 12:13 ` Segher Boessenkool 1 sibling, 0 replies; 11+ messages in thread From: Michael Ellerman @ 2006-03-23 23:11 UTC (permalink / raw) To: Olaf Hering; +Cc: linuxppc-dev On Thu, 2006-03-23 at 22:03 +0100, Olaf Hering wrote: > On Mon, Mar 06, Segher Boessenkool wrote: > > > That's better than always calling trap, sure. Is there any reason > > you can't just do it on Macs though? Because the problem you're trying > > to work around only happens there. > > Maybe something like this? Only compile tested > > > Do not call prom exit prom_panic. It clears the screen and the exit message is lost. > On some (or all?) pmacs it causes another crash when OF tries to print the > date and time in its banner. > > Set of_platform earlier to catch more prom_panic() calls. Looks reasonable, assuming it works :) cheers -- Michael Ellerman IBM OzLabs wwweb: http://michael.ellerman.id.au phone: +61 2 6212 1183 (tie line 70 21183) We do not inherit the earth from our ancestors, we borrow it from our children. - S.M.A.R.T Person ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] return to OF via trap, not exit 2006-03-23 21:03 ` Olaf Hering 2006-03-23 23:11 ` Michael Ellerman @ 2006-03-24 12:13 ` Segher Boessenkool 1 sibling, 0 replies; 11+ messages in thread From: Segher Boessenkool @ 2006-03-24 12:13 UTC (permalink / raw) To: Olaf Hering; +Cc: Michael Ellerman, linuxppc-dev On 23-mrt-2006, at 22:03, Olaf Hering wrote: > On Mon, Mar 06, Segher Boessenkool wrote: >> That's better than always calling trap, sure. Is there any reason >> you can't just do it on Macs though? Because the problem you're >> trying >> to work around only happens there. > > Maybe something like this? Only compile tested That looks fine yes (if it runs ;-) ), thanks! > Do not call prom exit prom_panic. It clears the screen and the exit > message is lost. > On some (or all?) pmacs it causes another crash when OF tries to > print the > date and time in its banner. > > Set of_platform earlier to catch more prom_panic() calls. > > Signed-off-by: Olaf Hering <olh@suse.de> Acked-by: Segher Boessenkool <segher@kernel.crashing.org> ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2006-03-24 12:11 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2006-03-04 19:10 [PATCH] return to OF via trap, not exit Olaf Hering 2006-03-06 1:12 ` Michael Ellerman 2006-03-06 7:38 ` Olaf Hering 2006-03-06 7:41 ` Segher Boessenkool 2006-03-06 7:43 ` Olaf Hering 2006-03-06 7:46 ` Segher Boessenkool 2006-03-06 7:49 ` Olaf Hering 2006-03-06 7:57 ` Segher Boessenkool 2006-03-23 21:03 ` Olaf Hering 2006-03-23 23:11 ` Michael Ellerman 2006-03-24 12:13 ` Segher Boessenkool
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).