mtd: return badblockbits back
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Thu, 28 Apr 2011 17:26:59 +0000 (20:26 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 3 Jun 2011 00:31:43 +0000 (09:31 +0900)
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@ti.com>" here:
http://lists.infradead.org/pipermail/linux-mtd/2011-April/035221.html

Reported-by: Parth Saxena <parth.saxena@ti.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tested-by: Parth Saxena <parth.saxena@ti.com>
Acked-by: Parth Saxena <parth.saxena@ti.com>
Acked-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/mtd/nand/nand_base.c

index c54a4cb..d1345fc 100644 (file)
@@ -3112,6 +3112,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;