lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFLxGvzSosfd50=UUcSRgjiVw=48FP8hgxb9bhL9UDGHTBz9yw@mail.gmail.com>
Date:	Fri, 12 Jun 2015 11:49:31 +0200
From:	Richard Weinberger <richard.weinberger@...il.com>
To:	KOBAYASHI Yoshitake <yoshitake.kobayashi@...hiba.co.jp>
Cc:	David Woodhouse <dwmw2@...radead.org>,
	Brian Norris <computersforpeace@...il.com>,
	"linux-mtd@...ts.infradead.org" <linux-mtd@...ts.infradead.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] mtd: nand: support for Toshiba BENAND (Built-in ECC NAND)

On Thu, Jun 11, 2015 at 6:00 PM, KOBAYASHI Yoshitake
<yoshitake.kobayashi@...hiba.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.

> +       chip->ecc.size = mtd->writesize;
> +       chip->ecc.strength = 1;

BENAND can correct only one bit?
This would explain why you consider it as fast. ;-)

> +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.

-- 
Thanks,
//richard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ