From: Miquel Raynal Date: Wed, 13 Oct 2021 10:08:07 +0000 (+0200) Subject: mtd-tests: Read and write pages during speed tests X-Git-Tag: v2.1.4~4 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=a2c6bbcf2f8e32532e64350ab76609e5db3c431b;p=mtd-utils.git mtd-tests: Read and write pages during speed tests The speed test does reads and writes of different sizes: - eraseblock - page - two pages At least this is the theory because, as opposed to the legacy kernel module doing the same measurement, the userspace tool uses the subpage size (hence accessing the same page 4, 8 or 16 times depending on the subpage setting). Of course if the controller does not support subpages, this issue is not visible. Use mtd.min_io_size instead for non-NOR devices in order to get the right bandwidth (at least one that fits the logs). Signed-off-by: Miquel Raynal Signed-off-by: David Oberhollenzer --- diff --git a/tests/mtd-tests/flash_speed.c b/tests/mtd-tests/flash_speed.c index 0058269..2fc70a1 100644 --- a/tests/mtd-tests/flash_speed.c +++ b/tests/mtd-tests/flash_speed.c @@ -343,7 +343,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;