summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHuang Shijie <b32955@freescale.com>2013-04-08 16:56:46 +0800
committerGao Pan <pandy.gao@nxp.com>2016-03-28 12:52:54 +0800
commit3456a5863c6dafb9e76daa9afe19016f19c88f26 (patch)
treeeaa6fdbc7c794777dbf883bcf912e8c9584aa9c1
parentd410e45243d2597fe0e192b3e2c482b92fdd3050 (diff)
MLK-10934 mtd: use memcpy to replace the memcpy_fromio
During the read of NOR, the kernel actually calls the inline_map_copy_from() to read the data out. And inline_map_copy_from() will use the memcpy_fromio() to do the real job. The memcpy_fromio macro maps _memcpy_fromio() in the current code. But the _memcpy_fromio() will use readb() to do the copy work one byte by one byte. This makes the read performance of NOR very slow(about 2~3MB/s). A similiar discussion could be found in: http://lists.infradead.org/pipermail/linux-arm-kernel/2009-November/003860.html This patch replace the memcpy_fromio with memcpy which is optimized by the kernel. The following is the result from mtd_speedtest with M29W256GL7AN6E: ================================================= mtd_speedtest: MTD device: 2 mtd_speedtest: not NAND flash, assume page size is 512 bytes. mtd_speedtest: MTD device size 4194304, eraseblock size 131072, page size 512, count of eraseblocks 32, pages per eraseblock 256, OOB size 0 mtd_speedtest: testing eraseblock write speed mtd_speedtest: eraseblock write speed is 845 KiB/s mtd_speedtest: testing eraseblock read speed mtd_speedtest: eraseblock read speed is 19504 KiB/s mtd_speedtest: testing page write speed mtd_speedtest: page write speed is 845 KiB/s mtd_speedtest: testing page read speed mtd_speedtest: page read speed is 19140 KiB/s mtd_speedtest: testing 2 page write speed mtd_speedtest: 2 page write speed is 846 KiB/s mtd_speedtest: testing 2 page read speed mtd_speedtest: 2 page read speed is 19320 KiB/s mtd_speedtest: Testing erase speed mtd_speedtest: erase speed is 233 KiB/s mtd_speedtest: Testing 2x multi-block erase speed mtd_speedtest: 2x multi-block erase speed is 225 KiB/s mtd_speedtest: Testing 4x multi-block erase speed mtd_speedtest: 4x multi-block erase speed is 224 KiB/s mtd_speedtest: Testing 8x multi-block erase speed mtd_speedtest: 8x multi-block erase speed is 225 KiB/s mtd_speedtest: Testing 16x multi-block erase speed mtd_speedtest: 16x multi-block erase speed is 225 KiB/s mtd_speedtest: Testing 32x multi-block erase speed mtd_speedtest: 32x multi-block erase speed is 225 KiB/s mtd_speedtest: Testing 64x multi-block erase speed mtd_speedtest: 64x multi-block erase speed is 224 KiB/s mtd_speedtest: finished ================================================= (cherry-picked from: f1e5914ffd82d5326cbd30507d4f37d02a0da099) Signed-off-by: Huang Shijie <b32955@freescale.com>
-rw-r--r--include/linux/mtd/map.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h
index 29975c73a953..ef9b126639cc 100644
--- a/include/linux/mtd/map.h
+++ b/include/linux/mtd/map.h
@@ -454,7 +454,7 @@ static inline void inline_map_copy_from(struct map_info *map, void *to, unsigned
if (map->cached)
memcpy(to, (char *)map->cached + from, len);
else
- memcpy_fromio(to, map->virt + from, len);
+ memcpy(to, map->virt + from, len);
}
static inline void inline_map_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)