From patchwork Sat Mar 3 22:26:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 881099 X-Patchwork-Delegate: boris.brezillon@free-electrons.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=agner.ch Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mxFkx3Nr"; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=agner.ch header.i=@agner.ch header.b="CUad2TOv"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zv14305xvz9sWj for ; Sun, 4 Mar 2018 09:26:42 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=isRBHCiw9GK/Fn+tJdHNjZp4vjIfZLTITbQB8iVHoDc=; b=mxF kx3Nr3xgfkW0c+HoFtv879iE3TOWAKWkF08eFPc2yIRHDLZFGSfj5enoh3D+ayr6ZqDVHKqSDJKfx BZveAOdndRVS+0Gw8K7aVq+VZD0lX8x4bqZg8Y9AM1C9nXe8yvEmu72GfF+rYd5frtq5uqMsfH3LR ko0WFQZpvQ72BDB5NvF6bcvwkOsOev4Y1+u7D2e0v2WHClvVp+OrntbMU+wmLyP3dAuwvMfIiPV/4 ghaV5VOEusIQcXn1J2k3qWIoK1IooeX08yNQYFjNbcX87bfXQfzQTEu+qhC9RuQ3rpqec1caxti6O et/EPjHCeXxma86eiOW+2KdXRMn1L9w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1esFbz-0005sR-DQ; Sat, 03 Mar 2018 22:26:39 +0000 Received: from mail.kmu-office.ch ([2a02:418:6a02::a2]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1esFbx-0005r7-6O for linux-mtd@lists.infradead.org; Sat, 03 Mar 2018 22:26:38 +0000 Received: from trochilidae.lan (unknown [IPv6:2001:1620:c6e::127]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 0E1765C02D2; Sat, 3 Mar 2018 23:18:27 +0100 (CET) From: Stefan Agner To: boris.brezillon@free-electrons.com Subject: [PATCH v2] mtd: tests: check erase block count in page test Date: Sat, 3 Mar 2018 23:26:22 +0100 Message-Id: <20180303222622.2941-1-stefan@agner.ch> X-Mailer: git-send-email 2.16.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1520115507; bh=DqYlofgeMKn8a+Z0b7s9RfKu2Ga7oPPL+b5dkyrNeso=; h=From:To:Cc:Subject:Date:Message-Id; b=CUad2TOvY3ZCzdBD8iH3IdHJQ8pmAqOYj6amck1QG7vvJJfjZGu5Q6qjoDvF2X3g+U/DImBExKn0wGgJ51lLOnMicrHUJ63zhn6PXkLt/OozMYG4yxzz+1BHaboLF2exrUmo9gB5Iiyg5tEiUL1fmuHpcw/7vPRwhKIDxFb31GU= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180303_142637_394377_D67BA9CD X-CRM114-Status: GOOD ( 14.77 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: richard@nod.at, stefan@agner.ch, marek.vasut@gmail.com, linux-mtd@lists.infradead.org, cyrille.pitchen@wedev4u.fr, computersforpeace@gmail.com, dwmw2@infradead.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org When there is only a single erase block, the cross erase test does not report sensible errors. Warn in case there is only a single erase block instead of executing the test. 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)