diff mbox series

mtd-tests: use pages during readtest and stress

Message ID 20211202143852.3132942-1-ralph.siemsen@linaro.org
State Accepted
Commit 981d198cfc3545bb8226c336fdf001f067468e19
Headers show
Series mtd-tests: use pages during readtest and stress | expand

Commit Message

Ralph Siemsen Dec. 2, 2021, 2:38 p.m. UTC
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>
---
 tests/mtd-tests/flash_readtest.c | 2 +-
 tests/mtd-tests/flash_stress.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

David Oberhollenzer Dec. 6, 2021, 12:49 a.m. UTC | #1
Applied to mtd-utils.git master.

Thanks,

David
diff mbox series

Patch

diff --git a/tests/mtd-tests/flash_readtest.c b/tests/mtd-tests/flash_readtest.c
index c5fabc9..b4f4e10 100644
--- a/tests/mtd-tests/flash_readtest.c
+++ b/tests/mtd-tests/flash_readtest.c
@@ -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;
diff --git a/tests/mtd-tests/flash_stress.c b/tests/mtd-tests/flash_stress.c
index 249d8cb..b7a0fec 100644
--- a/tests/mtd-tests/flash_stress.c
+++ b/tests/mtd-tests/flash_stress.c
@@ -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;