[PATCH v4 8/8] mtd: sh_flctl: Use user oob data in hardware ECC mode

Brian Norris computersforpeace at gmail.com
Mon May 14 11:12:11 EDT 2012


On Mon, May 14, 2012 at 5:14 AM, Bastian Hecht <hechtb at googlemail.com> wrote:
> diff --git a/drivers/mtd/nand/sh_flctl.c b/drivers/mtd/nand/sh_flctl.c
> index 631f7ed..8a07212 100644
> --- a/drivers/mtd/nand/sh_flctl.c
> +++ b/drivers/mtd/nand/sh_flctl.c
> @@ -384,6 +395,7 @@ static int flctl_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
>                                uint8_t *buf, int oob_required, int page)
>  {
>        chip->read_buf(mtd, buf, mtd->writesize);
> +       chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
>        return 0;
>  }

Well, my 'oob_required' patches won the race for inclusion in
l2-mtd-2.6.git, so it's probably good to just use the 'oob_required'
parameter now. That is:

if (oob_required)
       chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);

> @@ -391,6 +403,7 @@ static void flctl_write_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
>                                   const uint8_t *buf, int oob_required)
>  {
>        chip->write_buf(mtd, buf, mtd->writesize);
> +       chip->write_buf(mtd, chip->oob_poi, mtd->oobsize);
>  }

Similar here:

if (oob_required)
       chip->write_buf(mtd, chip->oob_poi, mtd->oobsize);

Brian



More information about the linux-mtd mailing list