Re: [RESEND PATCH v2] mtd: spinand: read return badly if the last page has bitflips

2019-06-27 Thread liaoweixiong
Hi Miquel,

On 2019/6/28 AM2:17, Miquel Raynal wrote:
> Hi Miquel,
> 
> Miquel Raynal  wrote on Thu, 27 Jun 2019
> 19:06:44 +0200:
> 
>> Hello,
>>
>> Schrempf Frieder  wrote on Tue, 25 Jun
>> 2019 07:04:06 +:
>>
>>> Hi liaoweixiong,
>>>
>>> On 25.06.19 05:08, Greg KH wrote:  
 On Tue, Jun 25, 2019 at 09:02:29AM +0800, liaoweixiong wrote:
> In case of the last page containing bitflips (ret > 0),
> spinand_mtd_read() will return that number of bitflips for the last
> page. But to me it looks like it should instead return max_bitflips like
> it does when the last page read returns with 0.
>
> Signed-off-by: liaoweixiong   
>>
>> Please write your entire official first/last name(s)
>>

OK.

> Reviewed-by: Boris Brezillon 
> Reviewed-by: Frieder Schrempf   
>>
>> I am waiting your next version with Acked-by instead of Rewieved-by
>> tags and Greg's comment addressed.
> 
> Sorry for the mistake, R-b tags are fine here, don't touch that.
> The rest needs to be fixed though.
> 

OK.

> Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI 
> NANDs")  
>>
>> Finally, when we ask you to resend a patch, it means sending a new
>> version of the patch. So in the subject, you should not use the
>> [RESEND] keyword (which means you are sending something again exactly
>> as it was before, you just got ignored, for example) but instead you
>> should increment the version number (v3) and also write a nice
>> changelog after the three dashes '---' (will be ignored by Git when
>> applying).
>>
>> I would like to queue this for the next release so if you can do it
>> ASAP, that would be great.
>>

I will do it right now.

>> Thank you,
>> Miquèl
> 
> 
> 
> 
> Thanks,
> Miquèl
> 

-- 
liaoweixiong


Re: [RESEND PATCH v2] mtd: spinand: read return badly if the last page has bitflips

2019-06-27 Thread Miquel Raynal
Hi Miquel,

Miquel Raynal  wrote on Thu, 27 Jun 2019
19:06:44 +0200:

> Hello,
> 
> Schrempf Frieder  wrote on Tue, 25 Jun
> 2019 07:04:06 +:
> 
> > Hi liaoweixiong,
> > 
> > On 25.06.19 05:08, Greg KH wrote:  
> > > On Tue, Jun 25, 2019 at 09:02:29AM +0800, liaoweixiong wrote:
> > >> In case of the last page containing bitflips (ret > 0),
> > >> spinand_mtd_read() will return that number of bitflips for the last
> > >> page. But to me it looks like it should instead return max_bitflips like
> > >> it does when the last page read returns with 0.
> > >>
> > >> Signed-off-by: liaoweixiong   
> 
> Please write your entire official first/last name(s)
> 
> > >> Reviewed-by: Boris Brezillon 
> > >> Reviewed-by: Frieder Schrempf   
> 
> I am waiting your next version with Acked-by instead of Rewieved-by
> tags and Greg's comment addressed.

Sorry for the mistake, R-b tags are fine here, don't touch that.
The rest needs to be fixed though.

> > >> Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI 
> > >> NANDs")  
> 
> Finally, when we ask you to resend a patch, it means sending a new
> version of the patch. So in the subject, you should not use the
> [RESEND] keyword (which means you are sending something again exactly
> as it was before, you just got ignored, for example) but instead you
> should increment the version number (v3) and also write a nice
> changelog after the three dashes '---' (will be ignored by Git when
> applying).
> 
> I would like to queue this for the next release so if you can do it
> ASAP, that would be great.
> 
> Thank you,
> Miquèl




Thanks,
Miquèl


Re: [RESEND PATCH v2] mtd: spinand: read return badly if the last page has bitflips

2019-06-27 Thread Miquel Raynal
Hello,

Schrempf Frieder  wrote on Tue, 25 Jun
2019 07:04:06 +:

> Hi liaoweixiong,
> 
> On 25.06.19 05:08, Greg KH wrote:
> > On Tue, Jun 25, 2019 at 09:02:29AM +0800, liaoweixiong wrote:  
> >> In case of the last page containing bitflips (ret > 0),
> >> spinand_mtd_read() will return that number of bitflips for the last
> >> page. But to me it looks like it should instead return max_bitflips like
> >> it does when the last page read returns with 0.
> >>
> >> Signed-off-by: liaoweixiong 

Please write your entire official first/last name(s)

> >> Reviewed-by: Boris Brezillon 
> >> Reviewed-by: Frieder Schrempf 

I am waiting your next version with Acked-by instead of Rewieved-by
tags and Greg's comment addressed.
> >> Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI 
> >> NANDs")

Finally, when we ask you to resend a patch, it means sending a new
version of the patch. So in the subject, you should not use the
[RESEND] keyword (which means you are sending something again exactly
as it was before, you just got ignored, for example) but instead you
should increment the version number (v3) and also write a nice
changelog after the three dashes '---' (will be ignored by Git when
applying).

I would like to queue this for the next release so if you can do it
ASAP, that would be great.

Thank you,
Miquèl


Re: [RESEND PATCH v2] mtd: spinand: read return badly if the last page has bitflips

2019-06-25 Thread Schrempf Frieder
On 25.06.19 13:56, liaoweixiong wrote:
> Oh, i am sorry that i had misunderstanded your letter.

No problem ;)

> Thank you for your document and guidance.

You're welcome!

> On 2019/6/25 PM 3:04, Schrempf Frieder wrote:
>> Hi liaoweixiong,
>>
>> On 25.06.19 05:08, Greg KH wrote:
>>> On Tue, Jun 25, 2019 at 09:02:29AM +0800, liaoweixiong wrote:
 In case of the last page containing bitflips (ret > 0),
 spinand_mtd_read() will return that number of bitflips for the last
 page. But to me it looks like it should instead return max_bitflips like
 it does when the last page read returns with 0.

 Signed-off-by: liaoweixiong 
 Reviewed-by: Boris Brezillon 
 Reviewed-by: Frieder Schrempf 
 Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI 
 NANDs")
 ---
drivers/mtd/nand/spi/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> 
>>>
>>> This is not the correct way to submit patches for inclusion in the
>>> stable kernel tree.  Please read:
>>>   
>>> https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
>>> for how to do this properly.
>>>
>>> 
>>
>> FYI, you should not send the patch to sta...@vger.kernel.org, but
>> instead, as I said in my other reply, add the tag "Cc:
>> sta...@vger.kernel.org". See "Option 1" in the document Greg referred to.
>>
>> Thanks,
>> Frieder
>>
> 

[RESEND PATCH v2] mtd: spinand: read return badly if the last page has bitflips

2019-06-25 Thread liaoweixiong
In case of the last page containing bitflips (ret > 0),
spinand_mtd_read() will return that number of bitflips for the last
page. But to me it looks like it should instead return max_bitflips like
it does when the last page read returns with 0.

Signed-off-by: liaoweixiong 
Reviewed-by: Boris Brezillon 
Reviewed-by: Frieder Schrempf 
Cc: sta...@vger.kernel.org
Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI NANDs")
---
 drivers/mtd/nand/spi/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index 556bfdb..6b9388d 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -511,12 +511,12 @@ static int spinand_mtd_read(struct mtd_info *mtd, loff_t 
from,
if (ret == -EBADMSG) {
ecc_failed = true;
mtd->ecc_stats.failed++;
-   ret = 0;
} else {
mtd->ecc_stats.corrected += ret;
max_bitflips = max_t(unsigned int, max_bitflips, ret);
}
 
+   ret = 0;
ops->retlen += iter.req.datalen;
ops->oobretlen += iter.req.ooblen;
}
-- 
1.9.1



Re: [RESEND PATCH v2] mtd: spinand: read return badly if the last page has bitflips

2019-06-25 Thread liaoweixiong
Oh, i am sorry that i had misunderstanded your letter.
Thank you for your document and guidance.

On 2019/6/25 PM 3:04, Schrempf Frieder wrote:
> Hi liaoweixiong,
> 
> On 25.06.19 05:08, Greg KH wrote:
>> On Tue, Jun 25, 2019 at 09:02:29AM +0800, liaoweixiong wrote:
>>> In case of the last page containing bitflips (ret > 0),
>>> spinand_mtd_read() will return that number of bitflips for the last
>>> page. But to me it looks like it should instead return max_bitflips like
>>> it does when the last page read returns with 0.
>>>
>>> Signed-off-by: liaoweixiong 
>>> Reviewed-by: Boris Brezillon 
>>> Reviewed-by: Frieder Schrempf 
>>> Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI 
>>> NANDs")
>>> ---
>>>   drivers/mtd/nand/spi/core.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> 
>>
>> This is not the correct way to submit patches for inclusion in the
>> stable kernel tree.  Please read:
>>  https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
>> for how to do this properly.
>>
>> 
> 
> FYI, you should not send the patch to sta...@vger.kernel.org, but 
> instead, as I said in my other reply, add the tag "Cc: 
> sta...@vger.kernel.org". See "Option 1" in the document Greg referred to.
> 
> Thanks,
> Frieder
> 

-- 
liaoweixiong


Re: [RESEND PATCH v2] mtd: spinand: read return badly if the last page has bitflips

2019-06-25 Thread Schrempf Frieder
Hi liaoweixiong,

On 25.06.19 05:08, Greg KH wrote:
> On Tue, Jun 25, 2019 at 09:02:29AM +0800, liaoweixiong wrote:
>> In case of the last page containing bitflips (ret > 0),
>> spinand_mtd_read() will return that number of bitflips for the last
>> page. But to me it looks like it should instead return max_bitflips like
>> it does when the last page read returns with 0.
>>
>> Signed-off-by: liaoweixiong 
>> Reviewed-by: Boris Brezillon 
>> Reviewed-by: Frieder Schrempf 
>> Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI 
>> NANDs")
>> ---
>>   drivers/mtd/nand/spi/core.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 
> 
> This is not the correct way to submit patches for inclusion in the
> stable kernel tree.  Please read:
>  https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
> for how to do this properly.
> 
> 

FYI, you should not send the patch to sta...@vger.kernel.org, but 
instead, as I said in my other reply, add the tag "Cc: 
sta...@vger.kernel.org". See "Option 1" in the document Greg referred to.

Thanks,
Frieder

Re: [RESEND PATCH v2] mtd: spinand: read return badly if the last page has bitflips

2019-06-24 Thread Greg KH
On Tue, Jun 25, 2019 at 09:02:29AM +0800, liaoweixiong wrote:
> In case of the last page containing bitflips (ret > 0),
> spinand_mtd_read() will return that number of bitflips for the last
> page. But to me it looks like it should instead return max_bitflips like
> it does when the last page read returns with 0.
> 
> Signed-off-by: liaoweixiong 
> Reviewed-by: Boris Brezillon 
> Reviewed-by: Frieder Schrempf 
> Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI 
> NANDs")
> ---
>  drivers/mtd/nand/spi/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)



This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read:
https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.




[RESEND PATCH v2] mtd: spinand: read return badly if the last page has bitflips

2019-06-24 Thread liaoweixiong
In case of the last page containing bitflips (ret > 0),
spinand_mtd_read() will return that number of bitflips for the last
page. But to me it looks like it should instead return max_bitflips like
it does when the last page read returns with 0.

Signed-off-by: liaoweixiong 
Reviewed-by: Boris Brezillon 
Reviewed-by: Frieder Schrempf 
Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI NANDs")
---
 drivers/mtd/nand/spi/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index 556bfdb..6b9388d 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -511,12 +511,12 @@ static int spinand_mtd_read(struct mtd_info *mtd, loff_t 
from,
if (ret == -EBADMSG) {
ecc_failed = true;
mtd->ecc_stats.failed++;
-   ret = 0;
} else {
mtd->ecc_stats.corrected += ret;
max_bitflips = max_t(unsigned int, max_bitflips, ret);
}
 
+   ret = 0;
ops->retlen += iter.req.datalen;
ops->oobretlen += iter.req.ooblen;
}
-- 
1.9.1



Re: [RESEND PATCH v2] mtd: spinand: read return badly if the last page has bitflips

2019-06-24 Thread liaoweixiong
Um.. I am sorry. It is the first time for me to resend patch.
I will send this patch again with correct tags.

On 2019/6/24 PM10:47, Schrempf Frieder wrote:
> On 24.06.19 14:15, liaoweixiong wrote:
>> In case of the last page containing bitflips (ret > 0),
>> spinand_mtd_read() will return that number of bitflips for the last
>> page. But to me it looks like it should instead return max_bitflips like
>> it does when the last page read returns with 0.
>>
>> Signed-off-by: liaoweixiong 
>> Acked-by: Boris Brezillon 
>> Acked-by: Frieder Schrempf 
> 
> Why did you change our Reviewed-by tags to Acked-by tags?
> 
>> Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI 
>> NANDs")
>> ---
>>   drivers/mtd/nand/spi/core.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
>> index 556bfdb..6b9388d 100644
>> --- a/drivers/mtd/nand/spi/core.c
>> +++ b/drivers/mtd/nand/spi/core.c
>> @@ -511,12 +511,12 @@ static int spinand_mtd_read(struct mtd_info *mtd, 
>> loff_t from,
>>  if (ret == -EBADMSG) {
>>  ecc_failed = true;
>>  mtd->ecc_stats.failed++;
>> -ret = 0;
>>  } else {
>>  mtd->ecc_stats.corrected += ret;
>>  max_bitflips = max_t(unsigned int, max_bitflips, ret);
>>  }
>>   
>> +ret = 0;
>>  ops->retlen += iter.req.datalen;
>>  ops->oobretlen += iter.req.ooblen;
>>  }

-- 
liaoweixiong


Re: [RESEND PATCH v2] mtd: spinand: read return badly if the last page has bitflips

2019-06-24 Thread Schrempf Frieder
On 24.06.19 14:15, liaoweixiong wrote:
> In case of the last page containing bitflips (ret > 0),
> spinand_mtd_read() will return that number of bitflips for the last
> page. But to me it looks like it should instead return max_bitflips like
> it does when the last page read returns with 0.
> 
> Signed-off-by: liaoweixiong 
> Acked-by: Boris Brezillon 
> Acked-by: Frieder Schrempf 

Why did you change our Reviewed-by tags to Acked-by tags?

> Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI 
> NANDs")
> ---
>   drivers/mtd/nand/spi/core.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
> index 556bfdb..6b9388d 100644
> --- a/drivers/mtd/nand/spi/core.c
> +++ b/drivers/mtd/nand/spi/core.c
> @@ -511,12 +511,12 @@ static int spinand_mtd_read(struct mtd_info *mtd, 
> loff_t from,
>   if (ret == -EBADMSG) {
>   ecc_failed = true;
>   mtd->ecc_stats.failed++;
> - ret = 0;
>   } else {
>   mtd->ecc_stats.corrected += ret;
>   max_bitflips = max_t(unsigned int, max_bitflips, ret);
>   }
>   
> + ret = 0;
>   ops->retlen += iter.req.datalen;
>   ops->oobretlen += iter.req.ooblen;
>   }
> 

[RESEND PATCH v2] mtd: spinand: read return badly if the last page has bitflips

2019-06-24 Thread liaoweixiong
In case of the last page containing bitflips (ret > 0),
spinand_mtd_read() will return that number of bitflips for the last
page. But to me it looks like it should instead return max_bitflips like
it does when the last page read returns with 0.

Signed-off-by: liaoweixiong 
Acked-by: Boris Brezillon 
Acked-by: Frieder Schrempf 
Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI NANDs")
---
 drivers/mtd/nand/spi/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index 556bfdb..6b9388d 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -511,12 +511,12 @@ static int spinand_mtd_read(struct mtd_info *mtd, loff_t 
from,
if (ret == -EBADMSG) {
ecc_failed = true;
mtd->ecc_stats.failed++;
-   ret = 0;
} else {
mtd->ecc_stats.corrected += ret;
max_bitflips = max_t(unsigned int, max_bitflips, ret);
}
 
+   ret = 0;
ops->retlen += iter.req.datalen;
ops->oobretlen += iter.req.ooblen;
}
-- 
1.9.1



Re: [PATCH v2] mtd: spinand: read return badly if the last page has bitflips

2019-06-24 Thread liaoweixiong
OK, thanks for your reviewing. I will resend right now.

On 2019/6/24 PM3:37, Schrempf Frieder wrote:
> On 20.06.19 03:00, liaoweixiong wrote:
>> In case of the last page containing bitflips (ret > 0),
>> spinand_mtd_read() will return that number of bitflips for the last
>> page. But to me it looks like it should instead return max_bitflips like
>> it does when the last page read returns with 0.
>>
>> Signed-off-by: liaoweixiong 
> 
> Reviewed-by: Frieder Schrempf 
> 
> This should probably be resent with the following tags:
> 
> Cc: sta...@vger.kernel.org
> Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI 
> NANDs")
> 
>> ---
>>   drivers/mtd/nand/spi/core.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
>> index 556bfdb..6b9388d 100644
>> --- a/drivers/mtd/nand/spi/core.c
>> +++ b/drivers/mtd/nand/spi/core.c
>> @@ -511,12 +511,12 @@ static int spinand_mtd_read(struct mtd_info *mtd, 
>> loff_t from,
>>  if (ret == -EBADMSG) {
>>  ecc_failed = true;
>>  mtd->ecc_stats.failed++;
>> -ret = 0;
>>  } else {
>>  mtd->ecc_stats.corrected += ret;
>>  max_bitflips = max_t(unsigned int, max_bitflips, ret);
>>  }
>>   
>> +ret = 0;
>>  ops->retlen += iter.req.datalen;
>>  ops->oobretlen += iter.req.ooblen;
>>  }

-- 
liaoweixiong


Re: [PATCH v2] mtd: spinand: read return badly if the last page has bitflips

2019-06-24 Thread Schrempf Frieder
On 20.06.19 03:00, liaoweixiong wrote:
> In case of the last page containing bitflips (ret > 0),
> spinand_mtd_read() will return that number of bitflips for the last
> page. But to me it looks like it should instead return max_bitflips like
> it does when the last page read returns with 0.
> 
> Signed-off-by: liaoweixiong 

Reviewed-by: Frieder Schrempf 

This should probably be resent with the following tags:

Cc: sta...@vger.kernel.org
Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI 
NANDs")

> ---
>   drivers/mtd/nand/spi/core.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
> index 556bfdb..6b9388d 100644
> --- a/drivers/mtd/nand/spi/core.c
> +++ b/drivers/mtd/nand/spi/core.c
> @@ -511,12 +511,12 @@ static int spinand_mtd_read(struct mtd_info *mtd, 
> loff_t from,
>   if (ret == -EBADMSG) {
>   ecc_failed = true;
>   mtd->ecc_stats.failed++;
> - ret = 0;
>   } else {
>   mtd->ecc_stats.corrected += ret;
>   max_bitflips = max_t(unsigned int, max_bitflips, ret);
>   }
>   
> + ret = 0;
>   ops->retlen += iter.req.datalen;
>   ops->oobretlen += iter.req.ooblen;
>   }
> 

Re: [PATCH v2] mtd: spinand: read return badly if the last page has bitflips

2019-06-20 Thread Boris Brezillon
On Thu, 20 Jun 2019 09:00:16 +0800
liaoweixiong  wrote:

> In case of the last page containing bitflips (ret > 0),
> spinand_mtd_read() will return that number of bitflips for the last
> page. But to me it looks like it should instead return max_bitflips like
> it does when the last page read returns with 0.
> 
> Signed-off-by: liaoweixiong 

Reviewed-by: Boris Brezillon 

> ---
>  drivers/mtd/nand/spi/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
> index 556bfdb..6b9388d 100644
> --- a/drivers/mtd/nand/spi/core.c
> +++ b/drivers/mtd/nand/spi/core.c
> @@ -511,12 +511,12 @@ static int spinand_mtd_read(struct mtd_info *mtd, 
> loff_t from,
>   if (ret == -EBADMSG) {
>   ecc_failed = true;
>   mtd->ecc_stats.failed++;
> - ret = 0;
>   } else {
>   mtd->ecc_stats.corrected += ret;
>   max_bitflips = max_t(unsigned int, max_bitflips, ret);
>   }
>  
> + ret = 0;
>   ops->retlen += iter.req.datalen;
>   ops->oobretlen += iter.req.ooblen;
>   }



[PATCH v2] mtd: spinand: read return badly if the last page has bitflips

2019-06-19 Thread liaoweixiong
In case of the last page containing bitflips (ret > 0),
spinand_mtd_read() will return that number of bitflips for the last
page. But to me it looks like it should instead return max_bitflips like
it does when the last page read returns with 0.

Signed-off-by: liaoweixiong 
---
 drivers/mtd/nand/spi/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index 556bfdb..6b9388d 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -511,12 +511,12 @@ static int spinand_mtd_read(struct mtd_info *mtd, loff_t 
from,
if (ret == -EBADMSG) {
ecc_failed = true;
mtd->ecc_stats.failed++;
-   ret = 0;
} else {
mtd->ecc_stats.corrected += ret;
max_bitflips = max_t(unsigned int, max_bitflips, ret);
}
 
+   ret = 0;
ops->retlen += iter.req.datalen;
ops->oobretlen += iter.req.ooblen;
}
-- 
1.9.1