Lines Matching +full:read +full:- +full:out

1 // SPDX-License-Identifier: GPL-2.0-only
5 * Test read and write speed of a MTD device.
24 static int dev = -EINVAL;
47 loff_t addr = (loff_t)ebnum * mtd->erasesize; in multiblock_erase()
51 ei.len = mtd->erasesize * blocks; in multiblock_erase()
65 loff_t addr = (loff_t)ebnum * mtd->erasesize; in write_eraseblock()
67 return mtdtest_write(mtd, addr, mtd->erasesize, iobuf); in write_eraseblock()
73 loff_t addr = (loff_t)ebnum * mtd->erasesize; in write_eraseblock_by_page()
91 loff_t addr = (loff_t)ebnum * mtd->erasesize; in write_eraseblock_by_2pages()
109 loff_t addr = (loff_t)ebnum * mtd->erasesize; in read_eraseblock()
111 return mtdtest_read(mtd, addr, mtd->erasesize, iobuf); in read_eraseblock()
117 loff_t addr = (loff_t)ebnum * mtd->erasesize; in read_eraseblock_by_page()
135 loff_t addr = (loff_t)ebnum * mtd->erasesize; in read_eraseblock_by_2pages()
168 k = (uint64_t)goodebcnt * (mtd->erasesize / 1024) * 1000000; in calc_speed()
183 pr_info("Please specify a valid mtd-device via module parameter\n"); in mtd_speedtest_init()
185 return -EINVAL; in mtd_speedtest_init()
200 if (mtd->writesize == 1) { in mtd_speedtest_init()
205 pgsize = mtd->writesize; in mtd_speedtest_init()
207 tmp = mtd->size; in mtd_speedtest_init()
208 do_div(tmp, mtd->erasesize); in mtd_speedtest_init()
210 pgcnt = mtd->erasesize / pgsize; in mtd_speedtest_init()
215 (unsigned long long)mtd->size, mtd->erasesize, in mtd_speedtest_init()
216 pgsize, ebcnt, pgcnt, mtd->oobsize); in mtd_speedtest_init()
221 err = -ENOMEM; in mtd_speedtest_init()
222 iobuf = kmalloc(mtd->erasesize, GFP_KERNEL); in mtd_speedtest_init()
224 goto out; in mtd_speedtest_init()
226 get_random_bytes(iobuf, mtd->erasesize); in mtd_speedtest_init()
230 goto out; in mtd_speedtest_init()
233 goto out; in mtd_speedtest_init()
241 goto out; in mtd_speedtest_init()
251 goto out; in mtd_speedtest_init()
255 goto out; in mtd_speedtest_init()
261 /* Read all eraseblocks, 1 eraseblock at a time */ in mtd_speedtest_init()
262 pr_info("testing eraseblock read speed\n"); in mtd_speedtest_init()
269 goto out; in mtd_speedtest_init()
273 goto out; in mtd_speedtest_init()
277 pr_info("eraseblock read speed is %ld KiB/s\n", speed); in mtd_speedtest_init()
281 goto out; in mtd_speedtest_init()
291 goto out; in mtd_speedtest_init()
295 goto out; in mtd_speedtest_init()
301 /* Read all eraseblocks, 1 page at a time */ in mtd_speedtest_init()
302 pr_info("testing page read speed\n"); in mtd_speedtest_init()
309 goto out; in mtd_speedtest_init()
313 goto out; in mtd_speedtest_init()
317 pr_info("page read speed is %ld KiB/s\n", speed); in mtd_speedtest_init()
321 goto out; in mtd_speedtest_init()
331 goto out; in mtd_speedtest_init()
335 goto out; in mtd_speedtest_init()
341 /* Read all eraseblocks, 2 pages at a time */ in mtd_speedtest_init()
342 pr_info("testing 2 page read speed\n"); in mtd_speedtest_init()
349 goto out; in mtd_speedtest_init()
353 goto out; in mtd_speedtest_init()
357 pr_info("2 page read speed is %ld KiB/s\n", speed); in mtd_speedtest_init()
364 goto out; in mtd_speedtest_init()
369 /* Multi-block erase all eraseblocks */ in mtd_speedtest_init()
372 pr_info("Testing %dx multi-block erase speed\n", in mtd_speedtest_init()
385 goto out; in mtd_speedtest_init()
389 goto out; in mtd_speedtest_init()
395 pr_info("%dx multi-block erase speed is %ld KiB/s\n", in mtd_speedtest_init()
399 out: in mtd_speedtest_init()