[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <874opmy2ca.fsf@basil.nowhere.org>
Date: Mon, 26 Oct 2009 09:41:09 +0100
From: Andi Kleen <andi@...stfloor.org>
To: Michael Sundius <msundius@...co.com>
Cc: linux-kernel@...r.kernel.org, msundius@...dius.com
Subject: Re: [patch] delay panic during startup of kernel
Michael Sundius <msundius@...co.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@...ux.intel.com -- Speaking for myself only.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists