All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Arun Nagendran <arunrasppi@gmail.com>
Cc: kamlakant.patel@broadcom.com, manonuevo@micron.com,
	linux-mtd@lists.infradead.org
Subject: Re: [PATCH 4.13.0-rc6 1] mt29f_spinand: Fix to Enable the ECC for page read on program
Date: Wed, 23 Aug 2017 16:16:11 -0700	[thread overview]
Message-ID: <20170823231611.GD5193@kroah.com> (raw)
In-Reply-To: <CAMx9D-4=n1iDoJA5sVt3CCOgRjieYJ0rkcKL+c+S53tygs84TQ@mail.gmail.com>

On Wed, Aug 23, 2017 at 05:08:54PM -0400, Arun Nagendran wrote:
> staging:mt29f_spinand: Enable the ECC for page read on program.

Why is this line here?

> 
> we have to enable the ECC during page read in spinand_program_page function,
> because program page is over-writing only the specific data in the read page.
> at same time, if you turn off the ECC and read the page, we may read corrupted
> data with potential bit flips error.
> I verified this logic with GiGa Device part GD5F2GQ4RCYI, found this data
> corruption problem.
> 
> 
> --- a/drivers/staging/mt29f_spinand/mt29f_spinand.c
> +++ b/drivers/staging/mt29f_spinand/mt29f_spinand.c
> @@ -496,8 +496,12 @@ static int spinand_program_page(struct spi_device
> *spi_nand,
>         if (!wbuf)
>                 return -ENOMEM;
>  
> -       enable_read_hw_ecc = 0;
> -       spinand_read_page(spi_nand, page_id, 0, CACHE_BUF, wbuf);
> +       enable_read_hw_ecc = 1;
> +       retval = spinand_read_page(spi_nand, page_id, 0, CACHE_BUF, wbuf);
> +       {

Why the { here?

> +               dev_err(&spi_nand->dev, "ecc error on read page!!!\n");
> +               return retval;

So now you always fail no matter what happens?

Please always test your patches :(

> +       }
>  
>         for (i = offset, j = 0; i < len; i++, j++)
>                 wbuf[i] &= buf[j];
> 
> 
> Signed-off-by: Arun Nagendran <arunrasppi@gmail.com>


This has to go up in the changelog area for it to work properly.

thanks,

greg k-h

           reply	other threads:[~2017-08-23 23:16 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <CAMx9D-4=n1iDoJA5sVt3CCOgRjieYJ0rkcKL+c+S53tygs84TQ@mail.gmail.com>]

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=20170823231611.GD5193@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=arunrasppi@gmail.com \
    --cc=kamlakant.patel@broadcom.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=manonuevo@micron.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.