mtd: nand: Fix probe of Samsung NAND chips

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Aug 20 17:59:01 EDT 2010


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=cfe3fdadb16162327773ef01a575a32000b8c7f4
Commit:     cfe3fdadb16162327773ef01a575a32000b8c7f4
Parent:     065a1ed8de85583888b3d4f22c64b534a1fbdaaa
Author:     Tilman Sauerbeck <tilman at code-monkey.de>
AuthorDate: Fri Aug 20 14:01:47 2010 -0700
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Aug 20 22:26:20 2010 +0100

    mtd: nand: Fix probe of Samsung NAND chips
    
    Apparently, the check for a 6-byte ID string introduced by commit
    426c457a3216fac74e3d44dd39729b0689f4c7ab ("mtd: nand: extend NAND flash
    detection to new MLC chips") is NOT sufficient to determine whether or
    not a Samsung chip uses their new MLC detection scheme or the old,
    standard scheme. This adds a condition to check cell type.
    
    Signed-off-by: Tilman Sauerbeck <tilman at code-monkey.de>
    Signed-off-by: Brian Norris <norris at broadcom.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
    Cc: stable at kernel.org
---
 drivers/mtd/nand/nand_base.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index a22ed7b..d551ddd 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2866,6 +2866,7 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
 		 */
 		if (id_data[0] == id_data[6] && id_data[1] == id_data[7] &&
 				id_data[0] == NAND_MFR_SAMSUNG &&
+				(chip->cellinfo & NAND_CI_CELLTYPE_MSK) &&
 				id_data[5] != 0x00) {
 			/* Calc pagesize */
 			mtd->writesize = 2048 << (extid & 0x03);



More information about the linux-mtd-cvs mailing list