From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.bootlin.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eqmPh-0006Fm-0G for linux-mtd@lists.infradead.org; Tue, 27 Feb 2018 21:03:55 +0000 Date: Tue, 27 Feb 2018 22:03:28 +0100 From: Boris Brezillon To: Stefan Agner Cc: dwmw2@infradead.org, computersforpeace@gmail.com, boris.brezillon@free-electrons.com, marek.vasut@gmail.com, richard@nod.at, cyrille.pitchen@wedev4u.fr, linux-mtd@lists.infradead.org Subject: Re: [PATCH] mtd: tests: check erase block count in page test Message-ID: <20180227220328.546750db@bbrezillon> In-Reply-To: <20180226212703.1662-1-stefan@agner.ch> References: <20180226212703.1662-1-stefan@agner.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Mon, 26 Feb 2018 22:27:03 +0100 Stefan Agner 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 > --- > 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