mtd: return badblockbits back
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Thu, 28 Apr 2011 17:26:59 +0000 (20:26 +0300)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Wed, 25 May 2011 01:01:22 +0000 (02:01 +0100)
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: Saxena, Parth <parth.saxena@ti.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tested-by: Saxena, Parth <parth.saxena@ti.com>
Acked-by: Saxena, Parth <parth.saxena@ti.com>
Acked-by: Brian Norris <computersforpeace@gmail.com>
Cc: stable@kernel.org [2.6.36+]
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/nand/nand_base.c

index bc1c2e6ae4a4438761125e00126d0c1bd9fc48d5..2201ca70af24d57c1d51986f5f2ff0d42ab89c86 100644 (file)
@@ -3106,6 +3106,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;