Patchwork [1/5] mtd: OneNAND: return read error for 4KiB page read

login
register
mail settings
Submitter Adrian Hunter
Date Feb. 8, 2011, 10:02 a.m.
Message ID <1297159362-8407-2-git-send-email-adrian.hunter@nokia.com>
Download mbox | patch
Permalink /patch/82280/
State New
Headers show

Comments

Adrian Hunter - Feb. 8, 2011, 10:02 a.m.
When reading using the 4KiB page read function, I/O
errors could be ignored if more than 1 page was read
at a time.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
---
 drivers/mtd/onenand/onenand_base.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Kyungmin Park - Feb. 8, 2011, 10:21 a.m.
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>

On Tue, Feb 8, 2011 at 7:02 PM, Adrian Hunter <adrian.hunter@nokia.com> wrote:
> When reading using the 4KiB page read function, I/O
> errors could be ignored if more than 1 page was read
> at a time.
>
> Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
> ---
>  drivers/mtd/onenand/onenand_base.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
> index bac41ca..38e6d76 100644
> --- a/drivers/mtd/onenand/onenand_base.c
> +++ b/drivers/mtd/onenand/onenand_base.c
> @@ -1132,6 +1132,8 @@ static int onenand_mlc_read_ops_nolock(struct mtd_info *mtd, loff_t from,
>                        onenand_update_bufferram(mtd, from, !ret);
>                        if (ret == -EBADMSG)
>                                ret = 0;
> +                       if (ret)
> +                               break;
>                }
>
>                this->read_bufferram(mtd, ONENAND_DATARAM, buf, column, thislen);
> --
> 1.7.0.4
>
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
>

Patch

diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index bac41ca..38e6d76 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -1132,6 +1132,8 @@  static int onenand_mlc_read_ops_nolock(struct mtd_info *mtd, loff_t from,
 			onenand_update_bufferram(mtd, from, !ret);
 			if (ret == -EBADMSG)
 				ret = 0;
+			if (ret)
+				break;
 		}
 
 		this->read_bufferram(mtd, ONENAND_DATARAM, buf, column, thislen);