diff mbox

mtd: nand: tests: fix regression introduced in mtd_nandectest

Message ID 1456866240-26119-1-git-send-email-jorge.ramirez-ortiz@linaro.org
State Accepted
Commit c57753d4541d5104284abbdceb841e690394e55f
Headers show

Commit Message

Jorge Ramirez March 1, 2016, 9:04 p.m. UTC
Offending Commit: 6e94119 "mtd: nand: return consistent error codes in
ecc.correct() implementations"

The new error code was not being handled properly in double bit error
detection.

Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
---
 drivers/mtd/tests/mtd_nandecctest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Boris Brezillon March 1, 2016, 9:17 p.m. UTC | #1
Hi Jorge,

On Tue,  1 Mar 2016 16:04:00 -0500
Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org> wrote:

> Offending Commit: 6e94119 "mtd: nand: return consistent error codes in
> ecc.correct() implementations"
> 
> The new error code was not being handled properly in double bit error
> detection.
> 
> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>

Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>

Thanks,

Boris

> ---
>  drivers/mtd/tests/mtd_nandecctest.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/tests/mtd_nandecctest.c b/drivers/mtd/tests/mtd_nandecctest.c
> index 7931615..88b6c81 100644
> --- a/drivers/mtd/tests/mtd_nandecctest.c
> +++ b/drivers/mtd/tests/mtd_nandecctest.c
> @@ -187,7 +187,7 @@ static int double_bit_error_detect(void *error_data, void *error_ecc,
>  	__nand_calculate_ecc(error_data, size, calc_ecc);
>  	ret = __nand_correct_data(error_data, error_ecc, calc_ecc, size);
>  
> -	return (ret == -1) ? 0 : -EINVAL;
> +	return (ret == -EBADMSG) ? 0 : -EINVAL;
>  }
>  
>  static const struct nand_ecc_test nand_ecc_test[] = {
Franklin S Cooper Jr March 2, 2016, 3:50 p.m. UTC | #2
On 03/01/2016 03:17 PM, Boris Brezillon wrote:
> Hi Jorge,
>
> On Tue,  1 Mar 2016 16:04:00 -0500
> Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org> wrote:
>
>> Offending Commit: 6e94119 "mtd: nand: return consistent error codes in
>> ecc.correct() implementations"
>>
>> The new error code was not being handled properly in double bit error
>> detection.
>>
>> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
> Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
>
> Thanks,
>
> Boris

We just encountered this problem and this patch fixed it.
Tested-by: Franklin S Cooper Jr <fcooper@ti.com>
>> ---
>>  drivers/mtd/tests/mtd_nandecctest.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/mtd/tests/mtd_nandecctest.c b/drivers/mtd/tests/mtd_nandecctest.c
>> index 7931615..88b6c81 100644
>> --- a/drivers/mtd/tests/mtd_nandecctest.c
>> +++ b/drivers/mtd/tests/mtd_nandecctest.c
>> @@ -187,7 +187,7 @@ static int double_bit_error_detect(void *error_data, void *error_ecc,
>>  	__nand_calculate_ecc(error_data, size, calc_ecc);
>>  	ret = __nand_correct_data(error_data, error_ecc, calc_ecc, size);
>>  
>> -	return (ret == -1) ? 0 : -EINVAL;
>> +	return (ret == -EBADMSG) ? 0 : -EINVAL;
>>  }
>>  
>>  static const struct nand_ecc_test nand_ecc_test[] = {
>
>
Brian Norris March 5, 2016, 1:02 a.m. UTC | #3
On Wed, Mar 02, 2016 at 09:50:19AM -0600, Franklin S Cooper Jr. wrote:
> On 03/01/2016 03:17 PM, Boris Brezillon wrote:
> > On Tue,  1 Mar 2016 16:04:00 -0500
> > Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org> wrote:
> >
> >> Offending Commit: 6e94119 "mtd: nand: return consistent error codes in
> >> ecc.correct() implementations"
> >>
> >> The new error code was not being handled properly in double bit error
> >> detection.
> >>
> >> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
> > Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> >
> > Thanks,
> >
> > Boris
> 
> We just encountered this problem and this patch fixed it.
> Tested-by: Franklin S Cooper Jr <fcooper@ti.com>

Thanks! Pushed to linux-mtd.git. I'll see about sending this to Linus
for v4.5 still, since the regression is in v4.5-rc1.

Regards,
Brian
diff mbox

Patch

diff --git a/drivers/mtd/tests/mtd_nandecctest.c b/drivers/mtd/tests/mtd_nandecctest.c
index 7931615..88b6c81 100644
--- a/drivers/mtd/tests/mtd_nandecctest.c
+++ b/drivers/mtd/tests/mtd_nandecctest.c
@@ -187,7 +187,7 @@  static int double_bit_error_detect(void *error_data, void *error_ecc,
 	__nand_calculate_ecc(error_data, size, calc_ecc);
 	ret = __nand_correct_data(error_data, error_ecc, calc_ecc, size);
 
-	return (ret == -1) ? 0 : -EINVAL;
+	return (ret == -EBADMSG) ? 0 : -EINVAL;
 }
 
 static const struct nand_ecc_test nand_ecc_test[] = {