[PATCH] mtd: tests: check erase block count in page test

Boris Brezillon boris.brezillon at bootlin.com
Tue Feb 27 13:03:28 PST 2018


On Mon, 26 Feb 2018 22:27:03 +0100
Stefan Agner <stefan at agner.ch> wrote:

> When there is only a single erase block, the cross talk test

Not sure cross talk is the appropriate term here. Why not cross erase
test?

> does not report sensible errors. Warn in case there is only
> a single erase block instead of executing the test.

I guess the equivalent userspace test [1], suffer from the same
problem. Could you fix it too?
Also, I encourage everyone to use the userspace tests, since kernel ones
will be removed at some point.

[1]http://git.infradead.org/mtd-utils.git/blob/refs/heads/master:/tests/mtd-tests/nandpagetest.c

> 
> Signed-off-by: Stefan Agner <stefan at agner.ch>
> ---
>  drivers/mtd/tests/pagetest.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mtd/tests/pagetest.c b/drivers/mtd/tests/pagetest.c
> index ff1e0565b020..bc303cac9f43 100644
> --- a/drivers/mtd/tests/pagetest.c
> +++ b/drivers/mtd/tests/pagetest.c
> @@ -435,9 +435,13 @@ static int __init mtd_pagetest_init(void)
>  	if (err)
>  		goto out;
>  
> -	err = erasecrosstest();
> -	if (err)
> -		goto out;
> +	if (ebcnt > 1) {
> +		err = erasecrosstest();
> +		if (err)
> +			goto out;
> +	} else {
> +		pr_info("skipping erasecrosstest, 2 erase blocks needed\n");
> +	}
>  
>  	err = erasetest();
>  	if (err)



-- 
Boris Brezillon, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com



More information about the linux-mtd mailing list