From 07ef36efce401ce6ce1abfa8b8165252eea343f7 Mon Sep 17 00:00:00 2001 From: Matthieu CASTET Date: Fri, 19 Oct 2012 17:29:33 +0200 Subject: [PATCH] --- yaml --- r: 347166 b: refs/heads/master c: cd409c61287b81d432024c1dbfad292304bf5df3 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/mtd/mtdoops.c | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index 57df1a0a7269..37d7d4c8100b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7c8f680e96edbd9896b13b5e6ff39bc5852dce2a +refs/heads/master: cd409c61287b81d432024c1dbfad292304bf5df3 diff --git a/trunk/drivers/mtd/mtdoops.c b/trunk/drivers/mtd/mtdoops.c index f5b3f91fa1cc..97bb8f6304d4 100644 --- a/trunk/drivers/mtd/mtdoops.c +++ b/trunk/drivers/mtd/mtdoops.c @@ -271,7 +271,7 @@ static void find_next_position(struct mtdoops_context *cxt) if (count[0] == 0xffffffff && count[1] == 0xffffffff) mark_page_unused(cxt, page); - if (count[0] == 0xffffffff) + if (count[0] == 0xffffffff || count[1] != MTDOOPS_KERNMSG_MAGIC) continue; if (maxcount == 0xffffffff) { maxcount = count[0]; @@ -289,14 +289,13 @@ static void find_next_position(struct mtdoops_context *cxt) } } if (maxcount == 0xffffffff) { - cxt->nextpage = 0; - cxt->nextcount = 1; - schedule_work(&cxt->work_erase); - return; + cxt->nextpage = cxt->oops_pages - 1; + cxt->nextcount = 0; + } + else { + cxt->nextpage = maxpos; + cxt->nextcount = maxcount; } - - cxt->nextpage = maxpos; - cxt->nextcount = maxcount; mtdoops_inc_counter(cxt); }