From patchwork Mon Oct 18 07:23:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baruch Siach X-Patchwork-Id: 68127 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from canuck.infradead.org (canuck.infradead.org [134.117.69.58]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8CBB6B70F7 for ; Mon, 18 Oct 2010 18:27:12 +1100 (EST) Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1P7k4t-00031l-CD; Mon, 18 Oct 2010 07:24:15 +0000 Received: from tango.tkos.co.il ([62.219.50.35]) by canuck.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1P7k4p-00031R-8B for linux-mtd@lists.infradead.org; Mon, 18 Oct 2010 07:24:12 +0000 Received: from jasper.tkos.co.il (93-172-46-112.bb.netvision.net.il [93.172.46.112]) (authenticated bits=0) by tango.tkos.co.il (8.14.4/8.12.11) with ESMTP id o9I7Nueo028739; Mon, 18 Oct 2010 09:23:59 +0200 From: Baruch Siach To: Artem Bityutskiy Subject: [PATCH] nanddump: warn when the start address is not page aligned Date: Mon, 18 Oct 2010 09:23:25 +0200 Message-Id: <1909cbad57553279212f156a0c7cb20178981909.1287386497.git.baruch@tkos.co.il> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1287256127.1781.32.camel@brekeke> References: <1287256127.1781.32.camel@brekeke> X-Spam-Level: -2.212 () BAYES_00,RDNS_DYNAMIC X-Scanned-By: MIMEDefang 2.62 on 62.219.50.35 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20101018_032411_691410_00839587 X-CRM114-Status: GOOD ( 10.99 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: Baruch Siach , linux-mtd@lists.infradead.org X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org nanddump should be consistent with nandwrite, which does not accept non page aligned start addresses. Thus, non page aligned dumps are useless. To ease migration only warn for now. Add the plan of making this an error to feature-removal-schedule.txt. Signed-off-by: Baruch Siach --- feature-removal-schedule.txt | 12 +++++++++++- nanddump.c | 7 +++++++ 2 files changed, 18 insertions(+), 1 deletions(-) diff --git a/feature-removal-schedule.txt b/feature-removal-schedule.txt index 21bc8d4..f4ed2a3 100644 --- a/feature-removal-schedule.txt +++ b/feature-removal-schedule.txt @@ -27,5 +27,15 @@ So the plan is (to be done by Artem Bityutskiy): 3.1 adding a warning to make users stop using them 3.2 removing both options. --------------------------- -2. +2. nanddump: fail when the -s parameter is not page aligned + +nanddump should be consistent with nandwrite, and refuse accepting non page +aligned start addresses. These dumps are most likely useless, since nandwrite +won't write then at this location. Currently only a warning is issued to keep +backward compatibility during a transition period. This should become an error +after 1.5.0. + +To be done by Artem Bityutskiy. +--------------------------- +3. --------------------------- diff --git a/nanddump.c b/nanddump.c index 15bf9c4..bb649da 100644 --- a/nanddump.c +++ b/nanddump.c @@ -360,6 +360,13 @@ int main(int argc, char * const argv[]) } /* Initialize start/end addresses and block size */ + if (start_addr & (meminfo.writesize - 1)) { + fprintf(stderr, "WARNING: The start address is not page-aligned !\n" + "The pagesize of this NAND Flash is 0x%x.\n" + "nandwrite doesn't allow writes starting at this location.\n" + "Future versions of nanddump will fail here.\n", + meminfo.writesize); + } if (length) end_addr = start_addr + length; if (!length || end_addr > meminfo.size)