How to distinguish MLC and SLC NANDs?

Brian Norris computersforpeace at gmail.com
Mon Sep 19 15:06:35 EDT 2011


On Thu, Sep 15, 2011 at 11:12 PM, Juergen Beisert <jbe at pengutronix.de> wrote:
> Brian Norris wrote:
>> chip->cellinfo & NAND_CI_CELLTYPE_MSK
>>
>> According to the data sheets for *most* NAND parts, this is a safe way
>> of determining SLC vs. MLC (non-zero => MLC; zero => SLC), and we use
>> it for certain detection code paths.
>
> Hmm, *most* means this information is not reliable?

*most* means a few things here:

1) this mechanism is only used for a small portion of our detection
code and doesn't have a wide variety of test coverage, I don't think.
If this code were incorrect, most users of this code would at most get
a slightly different bad block scanning pattern; this kind of issue
isn't always real easy to notice. Also, there are some Samsung MLC
that rely on this info for their code path.
2) this mask is defined in many NAND data sheets so that it is safe to
use on any chips that I have seen. Some don't specify everything but
still tend to follow this pattern.
3) NAND does not have a real standard for decoding ID bytes, although
there are a couple of patterns that have become de-facto standards
(with various exceptions, of course; none noticed on this particular
issue)

> Would it be better to give the driver a hint what kind of NAND it should expect via the platform_data?

Your prior knowledge of the NAND chip would probably be more reliable.

> I was in the hope of a perfect world and the MTD framework detects the NAND
> type reliable ;-). Now I tend more to use user's info from the platform_data.

Unfortunately, there is little perfection in NAND standards.

Brian



More information about the linux-mtd mailing list