[PATCH 1/2] mtdoops: do not schedule work if we are going to die

Simon Kagstrom simon.kagstrom at netinsight.net
Fri Oct 2 10:18:37 EDT 2009


I was working on the same fix :-)

On Thu,  1 Oct 2009 18:16:55 +0300
Aaro Koskinen <aaro.koskinen at nokia.com> wrote:

> diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c
> index 1060337..ac67833 100644
> --- a/drivers/mtd/mtdoops.c
> +++ b/drivers/mtd/mtdoops.c
> @@ -335,7 +335,7 @@ static void mtdoops_console_sync(void)
>  	cxt->ready = 0;
>  	spin_unlock_irqrestore(&cxt->writecount_lock, flags);
>  
> -	if (mtd->panic_write && in_interrupt())
> +	if (mtd->panic_write && (in_interrupt() || panic_on_oops))
>  		/* Interrupt context, we're going to panic so try and log */
>  		mtdoops_write(cxt, 1);

I believe we'll also need to make this module in-kernel with this
change, since panic_on_oops is not exported. I've sent another patch
that does these two things together.

I also get problems when mtd->read is called from mtdoops_inc_counter,
so my patch also skips this if we have panic_on_oops set (there is also
no point since the board will hang / be restarted after that).

// Simon



More information about the linux-mtd mailing list