From 6c27c43e7c3fbd516e8298957bf3567b2aef815d Mon Sep 17 00:00:00 2001 From: Lee Susman Date: Wed, 29 Jan 2014 11:55:21 +0200 Subject: [PATCH] scsi: ufs: fix sector increment in ufs_long_seq_test Currently, request sector is incremented in the long sequential test using a calculation which assumes the device logical block size is 512B (equal to sector size) but this is not the case. This patch changes the calculation to be correct, using the test bio size, and assuming sector size is 512B. Change-Id: I807be243b65834edf9201488a849777e43bb658a Signed-off-by: Lee Susman Signed-off-by: Yaniv Gardi --- drivers/scsi/ufs/ufs_test.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/ufs/ufs_test.c b/drivers/scsi/ufs/ufs_test.c index 6f208cd6b151..b702d09ed41f 100644 --- a/drivers/scsi/ufs/ufs_test.c +++ b/drivers/scsi/ufs/ufs_test.c @@ -39,6 +39,7 @@ #define MAX_PARALLEL_QUERIES 33 #define RANDOM_REQUEST_THREADS 4 #define LUN_DEPTH_TEST_SIZE 9 +#define SECTOR_SIZE 512 /* the amount of requests that will be inserted */ #define LONG_SEQ_TEST_NUM_REQS 256 @@ -941,11 +942,7 @@ static int run_long_test(struct test_data *td) direction = WRITE; } - /* NUM_OF_BLOCK * (BLOCK_SIZE / SECTOR_SIZE) */ - seq_sector_delta = num_bios_per_request * (PAGE_SIZE / - td->req_q->limits.logical_block_size); - /* just for the first iteration */ - sector -= seq_sector_delta; + seq_sector_delta = num_bios_per_request * (TEST_BIO_SIZE / SECTOR_SIZE); seed = utd->random_test_seed ? utd->random_test_seed : MAGIC_SEED; @@ -969,7 +966,9 @@ static int run_long_test(struct test_data *td) case UFS_TEST_LONG_SEQUENTIAL_READ: case UFS_TEST_LONG_SEQUENTIAL_WRITE: case UFS_TEST_LONG_SEQUENTIAL_MIXED: - sector += seq_sector_delta; + /* don't need to increment on the first iteration */ + if (inserted_requests) + sector += seq_sector_delta; break; case UFS_TEST_LONG_RANDOM_READ: case UFS_TEST_LONG_RANDOM_WRITE: