aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/card/mmc_test.c
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@nokia.com>2011-02-08 06:41:01 -0500
committerChris Ball <cjb@laptop.org>2011-03-15 13:48:40 -0400
commit0532ff6358ae00615cfba7212f5075356b437c66 (patch)
tree511fc89995f85823912df68784c48bf5ba32b462 /drivers/mmc/card/mmc_test.c
parent12f8ef8fb21f3b410b28eb57fc79bfe71232512a (diff)
mmc: mmc_test: make performance test area size about 4MiB
The test area size was set to the preferred erase size but for comparison purposes it is better if it is the same size for different devices. Make it a multiple of preferred erase size that is greater than or equal to 4MiB. Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/card/mmc_test.c')
-rw-r--r--drivers/mmc/card/mmc_test.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/mmc/card/mmc_test.c b/drivers/mmc/card/mmc_test.c
index 0131c6c0d8f6..ec6060c06ce8 100644
--- a/drivers/mmc/card/mmc_test.c
+++ b/drivers/mmc/card/mmc_test.c
@@ -1426,28 +1426,29 @@ static int mmc_test_area_cleanup(struct mmc_test_card *test)
1426} 1426}
1427 1427
1428/* 1428/*
1429 * Initialize an area for testing large transfers. The size of the area is the 1429 * Initialize an area for testing large transfers. The test area is set to the
1430 * preferred erase size which is a good size for optimal transfer speed. Note 1430 * middle of the card because cards may have different charateristics at the
1431 * that is typically 4MiB for modern cards. The test area is set to the middle 1431 * front (for FAT file system optimization). Optionally, the area is erased
1432 * of the card because cards may have different charateristics at the front 1432 * (if the card supports it) which may improve write performance. Optionally,
1433 * (for FAT file system optimization). Optionally, the area is erased (if the 1433 * the area is filled with data for subsequent read tests.
1434 * card supports it) which may improve write performance. Optionally, the area
1435 * is filled with data for subsequent read tests.
1436 */ 1434 */
1437static int mmc_test_area_init(struct mmc_test_card *test, int erase, int fill) 1435static int mmc_test_area_init(struct mmc_test_card *test, int erase, int fill)
1438{ 1436{
1439 struct mmc_test_area *t = &test->area; 1437 struct mmc_test_area *t = &test->area;
1440 unsigned long min_sz = 64 * 1024; 1438 unsigned long min_sz = 64 * 1024, sz;
1441 int ret; 1439 int ret;
1442 1440
1443 ret = mmc_test_set_blksize(test, 512); 1441 ret = mmc_test_set_blksize(test, 512);
1444 if (ret) 1442 if (ret)
1445 return ret; 1443 return ret;
1446 1444
1447 if (test->card->pref_erase > TEST_AREA_MAX_SIZE >> 9) 1445 /* Make the test area size about 4MiB */
1448 t->max_sz = TEST_AREA_MAX_SIZE; 1446 sz = (unsigned long)test->card->pref_erase << 9;
1449 else 1447 t->max_sz = sz;
1450 t->max_sz = (unsigned long)test->card->pref_erase << 9; 1448 while (t->max_sz < 4 * 1024 * 1024)
1449 t->max_sz += sz;
1450 while (t->max_sz > TEST_AREA_MAX_SIZE && t->max_sz > sz)
1451 t->max_sz -= sz;
1451 1452
1452 t->max_segs = test->card->host->max_segs; 1453 t->max_segs = test->card->host->max_segs;
1453 t->max_seg_sz = test->card->host->max_seg_size; 1454 t->max_seg_sz = test->card->host->max_seg_size;