[031/146] mtd: return badblockbits back

From: Greg KH
Date: Wed Jun 01 2011 - 04:09:14 EST


2.6.38-stable review patch. If anyone has any objections, please let us know.

------------------

From: Artem Bityutskiy <Artem.Bityutskiy@xxxxxxxxx>

commit 26d9be11485ea8c1102c3e8eaa7667412eef4950 upstream.

In commit c7b28e25cb9beb943aead770ff14551b55fa8c79 the initialization of
the backblockbits was accidentally removed. This patch returns it back,
because otherwise some NAND drivers are broken.

This problem was reported by "Saxena, Parth <parth.saxena@xxxxxx>" here:
http://lists.infradead.org/pipermail/linux-mtd/2011-April/035221.html

Reported-by: Parth Saxena <parth.saxena@xxxxxx>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@xxxxxxxxx>
Tested-by: Parth Saxena <parth.saxena@xxxxxx>
Acked-by: Parth Saxena <parth.saxena@xxxxxx>
Acked-by: Brian Norris <computersforpeace@xxxxxxxxx>
Signed-off-by: David Woodhouse <David.Woodhouse@xxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
drivers/mtd/nand/nand_base.c | 2 ++
1 file changed, 2 insertions(+)

--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -3111,6 +3111,8 @@ ident_done:
chip->chip_shift += 32 - 1;
}

+ chip->badblockbits = 8;
+
/* Set the bad block position */
if (mtd->writesize > 512 || (busw & NAND_BUSWIDTH_16))
chip->badblockpos = NAND_LARGE_BADBLOCK_POS;


--
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/