Re: [PATCH] mtd: mtdoops: mtdoops works with kexec correctly

From: Simon Kagstrom
Date: Mon Dec 21 2009 - 09:33:56 EST


On Mon, 21 Dec 2009 19:20:35 +0900 (JST)
KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx> wrote:

> commit 2e386e4ba(mtdoops: refactor as a kmsg_dumper) is very good patch.
> but unfortunately it doesn't works with kexec and few embedded user need
> to use kexec. there is no reason to don't implement it. it isn't so
> hard.
>
> FAQ
> ---
> Q. Why KMSG_DUMP_OOPS is insufficient?
> A. Because crash_kexec() is called before KMSG_DUMP_OOPS if
> panic_on_oops==1.
>
> Q. Why do you move KMSG_DUMP_PANIC call place?
> A. Otherwise kmsg_dump() is called twice if kexec enabled.
> it's annoy.

I think it would be better to describe these comments in text instead
of as FAQs. Because of the --- it's also removed from the git log.
Maybe something like

kmsg_dump: Dump on crash_kexec as well

crash_kexec gets called before kmsg_dump(KMSG_DUMP_OOPS) if
panic_on_oops is set, so the kernel log buffer is not stored
for this case.

This patch adds a KMSG_DUMP_KEXEC dump type which gets called
when crash_kexec() is invoked. To avoid getting double dumps,
the old KMSG_DUMP_PANIC is moved below crash_kexec(). The
mtdoops driver is modified to handle KMSG_DUMP_KEXEC in the
same way as a panic.


Other than that, it looks fine to me. I've done basic testing against
2.6.33-rc1, but unfortunately without kexec support.

Acked-by: Simon Kagstrom <simon.kagstrom@xxxxxxxxxxxxxx>

// Simon

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/