diff options
| author | Lee Susman <lsusman@codeaurora.org> | 2013-12-04 14:46:24 +0200 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-22 10:59:17 -0700 |
| commit | 580910dcef1cae040fcebbfdd371e4358f612719 (patch) | |
| tree | 96f93fa000ea0ae40fc44710e56610f42efd586a | |
| parent | 0f26d7cf9af8e5292cc061e1807ad6564b79d27c (diff) | |
scsi: ufs: add check_completion_fn to long_sequential unit test
This patch adds a completion condition to the long sequential unit test.
The condition is the completion of ALL the requests that where created.
Before this condition, the calculated test throughput was not accurate
since the transfered size was not constant.
This patch also increases the request size to the maximum - 128 bios.
In addition, the calculated throughput is always printed to the log.
Change-Id: Ibc16dc60486ff2b58cbc8ce02aee2ad87fea7ba1
Signed-off-by: Lee Susman <lsusman@codeaurora.org>
| -rw-r--r-- | drivers/scsi/ufs/ufs_test.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/scsi/ufs/ufs_test.c b/drivers/scsi/ufs/ufs_test.c index c5b058e5ac54..3d96b8daac98 100644 --- a/drivers/scsi/ufs/ufs_test.c +++ b/drivers/scsi/ufs/ufs_test.c @@ -28,7 +28,7 @@ #define MODULE_NAME "ufs_test" -#define TEST_MAX_BIOS_PER_REQ 16 +#define TEST_MAX_BIOS_PER_REQ 128 #define TEST_MAX_SECTOR_RANGE (10*1024*1024) /* 5GB */ #define LARGE_PRIME_1 1103515367 #define LARGE_PRIME_2 35757 @@ -601,6 +601,17 @@ static bool ufs_test_multi_thread_completion(void) utd->test_stage != UFS_TEST_LUN_DEPTH_TEST_RUNNING; } +static bool long_seq_test_check_completion(void) +{ + if (utd->completed_req_count > LONG_SEQ_TEST_NUM_REQS) { + pr_err("%s: Error: Completed more requests than total test requests" + , __func__); + pr_err("%s: Terminating test.", __func__); + return true; + } + return (utd->completed_req_count == LONG_SEQ_TEST_NUM_REQS); +} + /** * ufs_test_toggle_direction() - decides whether toggling is * needed. Toggle factor zero means no toggling. @@ -1024,6 +1035,8 @@ static ssize_t ufs_test_write(struct file *file, const char __user *buf, utd->test_info.run_test_fn = run_long_seq_test; utd->test_info.post_test_fn = long_seq_test_calc_throughput; utd->test_info.check_test_result_fn = ufs_test_check_result; + utd->test_info.check_test_completion_fn = + long_seq_test_check_completion; break; case UFS_TEST_LONG_SEQUENTIAL_MIXED: utd->test_info.timeout_msec = LONG_SEQUENTIAL_MIXED_TIMOUT_MS; |
