Bad assumption about ID field definition for Samsung NAND?

Brian Norris norris at
Fri Aug 20 17:01:47 EDT 2010

> Can I have a signed-off-by for it?

I don't know what's "legal" here. I'm appending the patch with a
sign-off for me and Tilman (since Tilman authored it). Hopefully that's

> Brian, I have a distinct impression that there's at least one more patch
> from you that I really ought to be sending to Linus for 2.6.36, but I
> can't find it right now. Other than this and what's already in
> mtd-2.6.git, is there anything else?

I'm really no expert on how inclusion for different versions goes; I
just send 'em to you! Anyway, this patch is *very* important:
	* [PATCH] mtd: nand: Fix regression in BBM detection
It addresses issues I overlooked with a lot of Hynix small-page NAND
(and others).

Other patches - they are ready, but not as important:
	* Spansion ORNAND
	* New Samsung MLC OOB sizes

No one has decided between these two (it's a "choose one or the other"
situation). They may or may not be ready:
	mtd: nand: Expand nand_ecc_layout, deprecate ioctl ECCGETLAYOUT
	Cover page:
	Choice 1:
	Choice 2:

And since you asked, the trivial...
	Indentation errors :)

You already got this one, I believe:
	Fixing a typo in on a buswidth option

Thanks for looking out for me :)



Apparently, the check for a 6-byte ID string 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

Signed-off-by: Tilman Sauerbeck <tilman at>
Signed-off-by: Brian Norris <norris at>
 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 a3c7473..172a299 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 mailing list