summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorRoman Tereshonkov <roman.tereshonkov@nokia.com>2011-12-02 17:07:17 +0400
committerGreg Kroah-Hartman <gregkh@suse.de>2012-01-26 05:24:32 +0400
commit13205eedda9d80daf129ddad54bd6ffe5df92dff (patch)
treee788206dad7160e8ff8b95ddfa9b714bdc90cb4c /drivers/mtd
parent63f0d35a610b2ef1139b5d763ee74cab5257a8c8 (diff)
downloadlinux-13205eedda9d80daf129ddad54bd6ffe5df92dff.tar.xz
mtd: mtdoops: skip reading initially bad blocks
commit 3538c56329936c78f7d356889908790006d0124c upstream. Use block_isbad to check and skip the bad blocks reading. This will allow to get rid of the read errors if bad blocks are present initially. Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/mtdoops.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c
index 02eeed3f9a41..43130e8aceac 100644
--- a/drivers/mtd/mtdoops.c
+++ b/drivers/mtd/mtdoops.c
@@ -253,6 +253,9 @@ static void find_next_position(struct mtdoops_context *cxt)
size_t retlen;
for (page = 0; page < cxt->oops_pages; page++) {
+ if (mtd->block_isbad &&
+ mtd->block_isbad(mtd, page * record_size))
+ continue;
/* Assume the page is used */
mark_page_used(cxt, page);
ret = mtd->read(mtd, page * record_size, MTDOOPS_HEADER_SIZE,