]> www.infradead.org Git - mtd-utils.git/commitdiff
nanddump: warn when the start address is not page aligned
authorBaruch Siach <baruch@tkos.co.il>
Mon, 18 Oct 2010 07:23:25 +0000 (09:23 +0200)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Mon, 18 Oct 2010 10:33:43 +0000 (13:33 +0300)
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.

Tweaked by Artem.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
feature-removal-schedule.txt
nanddump.c

index 21bc8d40f6962334c7876f19458776cc8c1e9020..4e9824a638a59ca7fdeeb808c0d5b989c6b46fd3 100644 (file)
@@ -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
+one release after the next release (current is mtd-utils-1.4.0, 18 Sep 2010).
+
+To be done by Artem Bityutskiy.
+---------------------------
+3.
 ---------------------------
index 15bf9c43cd66cf9217ae1fa438e2614a6ad32b55..bb649da6a9c3b1f10ee318f4a5c8640db54fa7e0 100644 (file)
@@ -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)