public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Michael Sundius <msundius@cisco.com>
Cc: linux-kernel@vger.kernel.org, msundius@sundius.com
Subject: Re: [patch] delay panic during startup of kernel
Date: Mon, 26 Oct 2009 09:41:09 +0100	[thread overview]
Message-ID: <874opmy2ca.fsf@basil.nowhere.org> (raw)
In-Reply-To: <4ADF9B78.4060807@cisco.com> (Michael Sundius's message of "Wed, 21 Oct 2009 16:38:32 -0700")

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.

      reply	other threads:[~2009-10-26  8:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-21 23:38 [patch] delay panic during startup of kernel Michael Sundius
2009-10-26  8:41 ` Andi Kleen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874opmy2ca.fsf@basil.nowhere.org \
    --to=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=msundius@cisco.com \
    --cc=msundius@sundius.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox