public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: KOBAYASHI Yoshitake <yoshitake.kobayashi@toshiba.co.jp>
Cc: richard@nod.at, dwmw2@infradead.org, computersforpeace@gmail.com,
	marek.vasut@gmail.com, cyrille.pitchen@wedev4u.fr,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] mtd: nand: Add support for Toshiba BENAND (Built-in ECC NAND)
Date: Tue, 6 Jun 2017 23:11:19 +0200	[thread overview]
Message-ID: <20170606231119.5f0fcf85@bbrezillon> (raw)
In-Reply-To: <ea24c8c5-4607-6018-bca2-3eb7deaff5b9@toshiba.co.jp>

On Mon, 5 Jun 2017 14:36:23 +0900
KOBAYASHI Yoshitake <yoshitake.kobayashi@toshiba.co.jp> wrote:

> Hi Boris,
> 
> Thank you very much for your detailed review.
> I just comming back from busy week for conference and started to look it.
> 
> I have a question regarding to the following comment.
> 
> >>  static int toshiba_nand_init(struct nand_chip *chip)
> >>  {
> >> +	struct mtd_info *mtd = nand_to_mtd(chip);
> >> +
> >>  	if (nand_is_slc(chip))
> >>  		chip->bbt_options |= NAND_BBT_SCAN2NDPAGE;
> >>  
> >> +	if (chip->ecc.mode == NAND_ECC_BENAND) {
> >> +		chip->ecc.options = NAND_ECC_CUSTOM_PAGE_ACCESS;
> >> +		chip->ecc.bytes = 0;  
> > 
> > It should be set to 16 according to the datasheet. But I guess this is
> > not exactly true. I'm pretty sure we can use some of these bytes to
> > store real data. Assuming you're using BCH, only 13bytes are needed for
> > 8bits/512bytes strength, and I guess the BBM region is also left
> > untouched (first 2 bytes of the OOB region).  
> 
> On BENAND, all OOB reginon can be used by user (driver). The calculated
> ECC data stored into other isolated area which is ubable to access from user.
> This is why chip->ecc.bytes = 0.

Oh, nice!

> To make sure this specification, I also checked the BENAND datasheet
> but unfortunatelly it was undocumented. Sorry for this confusion.

No problem. Do you think you can update the datasheet (or ask someone
who can) to clarify this aspect? As you said, it's really not clear
that these ECC bytes are actually stored in a dedicated region that is
invisible to users.

> 
> I think I can add comment here or add definition somewhere to describe this
> specification.

Yes please, add a comment in the code, just above the ->ecc.bytes = 0
assignment.

> If you have any preference or suggestion to describe this, please let me know.

Nope. Just put the explanation you give here.

  reply	other threads:[~2017-06-06 21:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-26  1:15 [PATCH -next] mtd: nand: Add support for Toshiba BENAND (Built-in ECC NAND) KOBAYASHI Yoshitake
2017-05-26 16:22 ` Boris Brezillon
2017-06-05  5:36   ` KOBAYASHI Yoshitake
2017-06-06 21:11     ` Boris Brezillon [this message]
2017-06-07  8:17       ` KOBAYASHI Yoshitake
2017-06-28 16:45   ` Jean-Louis Thekekara
2017-11-04  9:57     ` Boris Brezillon

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=20170606231119.5f0fcf85@bbrezillon \
    --to=boris.brezillon@free-electrons.com \
    --cc=computersforpeace@gmail.com \
    --cc=cyrille.pitchen@wedev4u.fr \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=richard@nod.at \
    --cc=yoshitake.kobayashi@toshiba.co.jp \
    /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