From: Juergen Beisert <jbe@pengutronix.de>
To: linux-mtd@lists.infradead.org
Cc: Brian Norris <computersforpeace@gmail.com>
Subject: Re: How to distinguish MLC and SLC NANDs?
Date: Fri, 16 Sep 2011 08:12:58 +0200 [thread overview]
Message-ID: <201109160812.58260.jbe@pengutronix.de> (raw)
In-Reply-To: <CAN8TOE9YctZ8hO7UTM9k7f8SBaWPzyBHyEgtK96Su5MRCrMjPA@mail.gmail.com>
Hi Brian,
Brian Norris wrote:
> On Thu, Sep 15, 2011 at 7:33 AM, Juergen Beisert <jbe@pengutronix.de> wrote:
> > Is there a unique pattern for MLC
> > or SLC in the mtd structure available after calling nand_scan_ident() to
> > select what correction sum type should be used for the attached NAND?
>
> Actually, there isn't anything available in struct mtd_info. This
> belongs in struct nand_chip, actually, since it's a NAND-specific
> feature. In fact, there is some data available there. As you can see
> in nand_get_flash_type() in nand_base.c, we fill in the
> `chip->cellinfo' field, then later use a mask on it like this:
>
> 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? Would it be better to give
the driver a hint what kind of NAND it should expect via the platform_data?
> Note that if the chip uses ONFI, you supply your own ID table, or the chip
> uses some of the older ID codes, nand_base.c won't set chip->cellinfo for
> you; but it will default to SLC I think, which is the correct option for old
> parts.
BTW: Is there a known disadvantage or incompatibility if I protect the data of
an SLC with the more stronger ECC sums intended for MLCs (beside the effect
the OOB area is more filled than required)?
> But it's up to you to determine your own reliance on this method. I
> don't know of any users who rely on `chip->cellinfo &
> NAND_CI_CELLTYPE_MSK' for this type of information.
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.
Thanks for your answer.
Juergen
--
Pengutronix e.K. | Juergen Beisert |
Linux Solutions for Science and Industry | http://www.pengutronix.de/ |
next prev parent reply other threads:[~2011-09-16 6:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-15 11:33 How to distinguish MLC and SLC NANDs? Juergen Beisert
2011-09-15 13:39 ` Brian Norris
2011-09-16 6:12 ` Juergen Beisert [this message]
2011-09-16 18:27 ` Atlant Schmidt
2011-09-19 19:06 ` Brian Norris
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201109160812.58260.jbe@pengutronix.de \
--to=jbe@pengutronix.de \
--cc=computersforpeace@gmail.com \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox