All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: KOBAYASHI Yoshitake <yoshitake.kobayashi@toshiba.co.jp>
To: Richard Weinberger <richard.weinberger@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] mtd: nand: support for Toshiba BENAND (Built-in ECC NAND)
Date: Tue, 16 Jun 2015 22:33:43 +0900	[thread overview]
Message-ID: <558025B7.3030103@toshiba.co.jp> (raw)
In-Reply-To: <CAFLxGvzSosfd50=UUcSRgjiVw=48FP8hgxb9bhL9UDGHTBz9yw@mail.gmail.com>

On 2015/06/12 18:49, Richard Weinberger wrote:
> On Thu, Jun 11, 2015 at 6:00 PM, KOBAYASHI Yoshitake
> <yoshitake.kobayashi@toshiba.co.jp> wrote:
>> This patch enables support for Toshiba BENAND.
>> BENAND is a SLC NAND solution that automatically generates ECC inside
>> NAND chip.
>>
>> Some of the comments in the following discussion may need to be considerd.
>>    https://lkml.org/lkml/2015/3/25/310
>
> Yep.
>
>> +void nand_benand_init(struct mtd_info *mtd)
>> +{
>> +       struct nand_chip *chip = mtd->priv;
>> +
>> +       pr_info("%s\n", __func__);
>
> Please kill all these prints. Use ftrace to trace function calls.

Okay, I will delete these prints in next patch.

>> +       chip->ecc.size = mtd->writesize;
>> +       chip->ecc.strength = 1;
>
> BENAND can correct only one bit?
> This would explain why you consider it as fast. ;-)

BENAND is able to correct up to 8bit. By issuing Status command 70h for read operation, BENAND
can report three types of ECC operation status (Pass / Fail(uncorrectable) / Recommended to rewrite).
Judgement for Recommended to rewrite is based on internal logic of BENAND.

>> +int nand_benand_status_chk(struct mtd_info *mtd, struct nand_chip *chip)
>> +{
>> +       unsigned int bitflips = 0;
>> +       u8 status;
>> +
>> +       pr_debug("%s\n", __func__);
>> +
>> +       /* Check Read Status */
>> +       chip->cmdfunc(mtd, NAND_CMD_STATUS, -1, -1);
>> +       status = chip->read_byte(mtd);
>> +
>> +       /* timeout */
>> +       if (!(status & NAND_STATUS_READY)) {
>> +               pr_info("BENAND : Time Out!\n");
>> +               return -EIO;
>> +       }
>> +
>> +       /* uncorrectable */
>> +       else if (status & NAND_STATUS_FAIL) {
>> +               pr_info("BENAND : Uncorrectable!\n");
>> +               mtd->ecc_stats.failed++;
>> +       }
>> +
>> +       /* correctable */
>> +       else if (status & NAND_STATUS_RECOM_REWRT) {
>> +               pr_info("BENAND : Recommended to rewrite!\n");
>> +               bitflips = chip->ecc.strength;
>
> In your case this might be okay, as you set strength to 1.
> Otherweise you'd have to report the real number of bitflips.

I also thought it is okay in this case.
BENAND return corrected data to Host NAND Controller till uncorrectable status.
The current patch uses this Read Status command 70h to abstract BENAND Multi
bit ECC and Need to Rewrite judgement so BENAND would look like 1bit ECC device.

  -- Yoshi


WARNING: multiple messages have this Message-ID (diff)
From: KOBAYASHI Yoshitake <yoshitake.kobayashi@toshiba.co.jp>
To: Richard Weinberger <richard.weinberger@gmail.com>
Cc: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] mtd: nand: support for Toshiba BENAND (Built-in ECC NAND)
Date: Tue, 16 Jun 2015 22:33:43 +0900	[thread overview]
Message-ID: <558025B7.3030103@toshiba.co.jp> (raw)
In-Reply-To: <CAFLxGvzSosfd50=UUcSRgjiVw=48FP8hgxb9bhL9UDGHTBz9yw@mail.gmail.com>

On 2015/06/12 18:49, Richard Weinberger wrote:
> On Thu, Jun 11, 2015 at 6:00 PM, KOBAYASHI Yoshitake
> <yoshitake.kobayashi@toshiba.co.jp> wrote:
>> This patch enables support for Toshiba BENAND.
>> BENAND is a SLC NAND solution that automatically generates ECC inside
>> NAND chip.
>>
>> Some of the comments in the following discussion may need to be considerd.
>>    https://lkml.org/lkml/2015/3/25/310
>
> Yep.
>
>> +void nand_benand_init(struct mtd_info *mtd)
>> +{
>> +       struct nand_chip *chip = mtd->priv;
>> +
>> +       pr_info("%s\n", __func__);
>
> Please kill all these prints. Use ftrace to trace function calls.

Okay, I will delete these prints in next patch.

>> +       chip->ecc.size = mtd->writesize;
>> +       chip->ecc.strength = 1;
>
> BENAND can correct only one bit?
> This would explain why you consider it as fast. ;-)

BENAND is able to correct up to 8bit. By issuing Status command 70h for read operation, BENAND
can report three types of ECC operation status (Pass / Fail(uncorrectable) / Recommended to rewrite).
Judgement for Recommended to rewrite is based on internal logic of BENAND.

>> +int nand_benand_status_chk(struct mtd_info *mtd, struct nand_chip *chip)
>> +{
>> +       unsigned int bitflips = 0;
>> +       u8 status;
>> +
>> +       pr_debug("%s\n", __func__);
>> +
>> +       /* Check Read Status */
>> +       chip->cmdfunc(mtd, NAND_CMD_STATUS, -1, -1);
>> +       status = chip->read_byte(mtd);
>> +
>> +       /* timeout */
>> +       if (!(status & NAND_STATUS_READY)) {
>> +               pr_info("BENAND : Time Out!\n");
>> +               return -EIO;
>> +       }
>> +
>> +       /* uncorrectable */
>> +       else if (status & NAND_STATUS_FAIL) {
>> +               pr_info("BENAND : Uncorrectable!\n");
>> +               mtd->ecc_stats.failed++;
>> +       }
>> +
>> +       /* correctable */
>> +       else if (status & NAND_STATUS_RECOM_REWRT) {
>> +               pr_info("BENAND : Recommended to rewrite!\n");
>> +               bitflips = chip->ecc.strength;
>
> In your case this might be okay, as you set strength to 1.
> Otherweise you'd have to report the real number of bitflips.

I also thought it is okay in this case.
BENAND return corrected data to Host NAND Controller till uncorrectable status.
The current patch uses this Read Status command 70h to abstract BENAND Multi
bit ECC and Need to Rewrite judgement so BENAND would look like 1bit ECC device.

  -- Yoshi

  reply	other threads:[~2015-06-16 13:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-11 16:00 [PATCH v2] mtd: nand: support for Toshiba BENAND (Built-in ECC NAND) KOBAYASHI Yoshitake
2015-06-12  8:11 ` Paul Bolle
2015-06-12  8:11   ` Paul Bolle
2015-06-16 13:37   ` KOBAYASHI Yoshitake
2015-06-16 13:37     ` KOBAYASHI Yoshitake
2015-06-12  9:49 ` Richard Weinberger
2015-06-12  9:49   ` Richard Weinberger
2015-06-16 13:33   ` KOBAYASHI Yoshitake [this message]
2015-06-16 13:33     ` KOBAYASHI Yoshitake
2015-06-16 13:53     ` Richard Weinberger
2015-06-16 13:53       ` Richard Weinberger
2015-06-19 14:46       ` KOBAYASHI Yoshitake
2015-06-19 14:46         ` KOBAYASHI Yoshitake
2015-07-24 17:42 ` [PATCH REPOST v3] mtd: nand " KOBAYASHI Yoshitake

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=558025B7.3030103@toshiba.co.jp \
    --to=yoshitake.kobayashi@toshiba.co.jp \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard.weinberger@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.