From patchwork Mon Feb 22 13:52:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gstir X-Patchwork-Id: 586171 X-Patchwork-Delegate: david.oberhollenzer@sigma-star.at Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 77B4B140A68 for ; Tue, 23 Feb 2016 00:54:33 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aXquu-0001rn-5L; Mon, 22 Feb 2016 13:52:48 +0000 Received: from mail.sigma-star.at ([95.130.255.111]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aXquk-0001TQ-Bg for linux-mtd@lists.infradead.org; Mon, 22 Feb 2016 13:52:44 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.sigma-star.at (Postfix) with ESMTP id 76CCB16B4321; Mon, 22 Feb 2016 14:52:16 +0100 (CET) X-Virus-Scanned: amavisd-new at mail.sigma-star.at Received: from spire-linux.lan (david.vpn.sigmapriv.at [10.3.0.113]) by mail.sigma-star.at (Postfix) with ESMTPSA id DB22F16B431E; Mon, 22 Feb 2016 14:52:15 +0100 (CET) From: David Gstir To: linux-mtd@lists.infradead.org Subject: [PATCH 2/3] ubi: tests: Support up to 65k NAND page size Date: Mon, 22 Feb 2016 14:52:04 +0100 Message-Id: <1456149125-24067-2-git-send-email-david@sigma-star.at> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1456149125-24067-1-git-send-email-david@sigma-star.at> References: <1456149125-24067-1-git-send-email-david@sigma-star.at> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160222_055239_205620_7FDC70A8 X-CRM114-Status: GOOD ( 13.00 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: richard@nod.at, David Gstir MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Richard Weinberger io_read and io_update of mtd-utils support NAND with 4k page size only. Increase that to support up to 65k page size. Signed-off-by: Richard Weinberger Signed-off-by: David Gstir --- tests/ubi-tests/helpers.h | 2 +- tests/ubi-tests/io_read.c | 6 +++--- tests/ubi-tests/io_update.c | 22 +++++++++++----------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/ubi-tests/helpers.h b/tests/ubi-tests/helpers.h index d7d6d9c..4533f4b 100644 --- a/tests/ubi-tests/helpers.h +++ b/tests/ubi-tests/helpers.h @@ -32,7 +32,7 @@ extern "C" { #define UBI_VOLUME_PATTERN "/dev/ubi%d_%d" #define MIN_AVAIL_EBS 5 -#define PAGE_SIZE 4096 +#define MAX_NAND_PAGE_SIZE 65536 #define errorm(fmt, ...) ({ \ __errorm(PROGRAM_NAME, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__); \ diff --git a/tests/ubi-tests/io_read.c b/tests/ubi-tests/io_read.c index 386291e..f48db67 100644 --- a/tests/ubi-tests/io_read.c +++ b/tests/ubi-tests/io_read.c @@ -41,7 +41,7 @@ static int fd; /* Data lengthes to test, @io - minimal I/O unit size, @s - eraseblock size */ #define LENGTHES(io, s) \ {1, (io), (io)+1, 2*(io), 3*(io)-1, 3*(io), \ - PAGE_SIZE-1, PAGE_SIZE-(io), 2*PAGE_SIZE, 2*PAGE_SIZE-(io), \ + MAX_NAND_PAGE_SIZE-1, MAX_NAND_PAGE_SIZE-(io), 2*MAX_NAND_PAGE_SIZE, 2*MAX_NAND_PAGE_SIZE-(io), \ (s)/2-1, (s)/2, (s)/2+1, (s)-1, (s), (s)+1, 2*(s)-(io), 2*(s), \ 2*(s)+(io), 3*(s), 3*(s)+(io)}; @@ -51,9 +51,9 @@ static int fd; */ #define OFFSETS(io, s, sz) \ {0, (io)-1, (io), (io)+1, 2*(io)-1, 2*(io), 3*(io)-1, 3*(io), \ - PAGE_SIZE-1, PAGE_SIZE-(io), 2*PAGE_SIZE, 2*PAGE_SIZE-(io), \ + MAX_NAND_PAGE_SIZE-1, MAX_NAND_PAGE_SIZE-(io), 2*MAX_NAND_PAGE_SIZE, 2*MAX_NAND_PAGE_SIZE-(io), \ (s)/2-1, (s)/2, (s)/2+1, (s)-1, (s), (s)+1, 2*(s)-(io), 2*(s), \ - 2*(s)+(io), 3*(s), (sz)-(s)-1, (sz)-(io)-1, (sz)-PAGE_SIZE-1}; + 2*(s)+(io), 3*(s), (sz)-(s)-1, (sz)-(io)-1, (sz)-MAX_NAND_PAGE_SIZE-1}; /** * test_static - test static volume-specific features. diff --git a/tests/ubi-tests/io_update.c b/tests/ubi-tests/io_update.c index 2e9969e..7040e6a 100644 --- a/tests/ubi-tests/io_update.c +++ b/tests/ubi-tests/io_update.c @@ -44,22 +44,22 @@ const char *node; {512}, \ {666}, \ {2048}, \ - {(io), (io), PAGE_SIZE}, \ - {(io)+1, (io)+1, PAGE_SIZE}, \ - {PAGE_SIZE}, \ - {PAGE_SIZE-1}, \ - {PAGE_SIZE+(io)}, \ + {(io), (io), MAX_NAND_PAGE_SIZE}, \ + {(io)+1, (io)+1, MAX_NAND_PAGE_SIZE}, \ + {MAX_NAND_PAGE_SIZE}, \ + {MAX_NAND_PAGE_SIZE-1}, \ + {MAX_NAND_PAGE_SIZE+(io)}, \ {(s)}, \ {(s)-1}, \ {(s)+1}, \ {(io), (s)+1}, \ - {(s)+(io), PAGE_SIZE}, \ - {2*(s), PAGE_SIZE}, \ - {PAGE_SIZE, 2*(s), 1}, \ - {PAGE_SIZE, 2*(s)}, \ + {(s)+(io), MAX_NAND_PAGE_SIZE}, \ + {2*(s), MAX_NAND_PAGE_SIZE}, \ + {MAX_NAND_PAGE_SIZE, 2*(s), 1}, \ + {MAX_NAND_PAGE_SIZE, 2*(s)}, \ {2*(s)-1, 2*(s)-1}, \ - {3*(s), PAGE_SIZE + 1}, \ - {1, PAGE_SIZE}, \ + {3*(s), MAX_NAND_PAGE_SIZE + 1}, \ + {1, MAX_NAND_PAGE_SIZE}, \ {(io), (s)} \ }