public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] mtdoops at panic
@ 2008-09-16  8:10 Edgar E. Iglesias
  0 siblings, 0 replies; only message in thread
From: Edgar E. Iglesias @ 2008-09-16  8:10 UTC (permalink / raw)
  To: linux-mtd

Hello,

While trying out the mtdoops module I ran into trouble when logging at panic.
Turns out that the mtdoops_inc_counter can sleep while preparing for the next
entry.

This small patch works fine for me.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@axis.com>

diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c
index 5a680e1..de6d151 100644
--- a/drivers/mtd/mtdoops.c
+++ b/drivers/mtd/mtdoops.c
@@ -208,7 +208,12 @@ static void mtdoops_write(struct mtdoops_context *cxt, int panic)
 		printk(KERN_ERR "mtdoops: Write failure at %d (%td of %d written), err %d.\n",
 			cxt->nextpage * OOPS_PAGE_SIZE, retlen,	OOPS_PAGE_SIZE, ret);
 
-	mtdoops_inc_counter(cxt);
+	/*
+	 * Prepare for next log-entry. If we are in panic we'll defer this
+	 * step to after reboot because mtdoops_inc_counter might sleep.
+	 */
+	if (!panic)
+		mtdoops_inc_counter(cxt);
 }
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-09-16  8:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-16  8:10 [PATCH] mtdoops at panic Edgar E. Iglesias

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox