]> www.infradead.org Git - mtd-utils.git/commitdiff
mtd-tests: use pages during readtest and stress
authorRalph Siemsen <ralph.siemsen@linaro.org>
Thu, 2 Dec 2021 14:38:52 +0000 (09:38 -0500)
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Mon, 6 Dec 2021 00:47:02 +0000 (01:47 +0100)
Same fix as a2c6bbc ("mtd-tests: Read and write pages during speed
tests") but applied to flash_readtest and flash_stress.

Resolves failure of flash_readtest when subpages are present. The test
reads a (sub)page followed by the entire OOB. Upon reaching the 2nd
subpage, the OOB read fails because it is beyond the end of OOB.

Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
tests/mtd-tests/flash_readtest.c
tests/mtd-tests/flash_stress.c

index c5fabc94dab9117c25b3eff065edad0160e0420c..b4f4e104ebf176386a49e2c15bc925da31fbee5c 100644 (file)
@@ -227,7 +227,7 @@ int main(int argc, char **argv)
                puts("not NAND flash, assume page size is 512 bytes.");
                pgsize = 512;
        } else {
-               pgsize = mtd.subpage_size;
+               pgsize = mtd.min_io_size;
        }
 
        pgcnt = mtd.eb_size / pgsize;
index 249d8cbc6c4cbd5e445b69a38d4fdd7a6a5c5334..b7a0fec2b8d812777285709cc8cdc277666b71f1 100644 (file)
@@ -242,7 +242,7 @@ int main(int argc, char **argv)
                puts("not NAND flash, assume page size is 512 bytes.");
                pgsize = 512;
        } else {
-               pgsize = mtd.subpage_size;
+               pgsize = mtd.min_io_size;
        }
 
        pgcnt = mtd.eb_size / pgsize;