lkml.org 
[lkml]   [2009]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch] delay panic during startup of kernel
From
Date
Michael Sundius <msundius@cisco.com> writes:

> We've been, from time to time, running into various problems early on
> the initialization of the kernel, encountering situations where we really
> should panic, but we can't because its too early to do so.
> (see * if you care to know why this is a problem for us). Anyhow, I've
> created this patch to have a little better way of orderly finishing the
> bring-up to the point where we can panic safely. Any comments?

It's (nearly) never too early to panic. The main problem is that you sometimes
cannot see it and sometimes panic requires some state (but that's usually
a bug in panic to be fixed)

I also don't think it makes much sense to continue just to panic later.
Such a continue path is likely untested and buggy.

Some time ago I had patches to do a early_panic() using early_printk,
but didn't end up submitting them because the caller I intended them
for disappeared.

Basically early_panic() is just

void early_panic(char *fmt, ...)
{
char buf[256];
va_list ap;
va_start(ap, fmt);
vsnprintf(buf, sizeof buf, fmt, ap);
early_printk("PANIC : %s\n", buf);
va_end(ap);
for (;;)
safe_hlt();
}


However it might be better to fix panic to do that automatically.

-Andi


--
ak@linux.intel.com -- Speaking for myself only.


\
 
 \ /
  Last update: 2009-10-26 09:43    [W:3.164 / U:0.924 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site