Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 211b98ff authored by Lee Susman's avatar Lee Susman Committed by Matt Wagantall
Browse files

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: default avatarLee Susman <lsusman@codeaurora.org>
Signed-off-by: default avatarYaniv Gardi <ygardi@codeaurora.org>
parent e9d0d795
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -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,6 +966,8 @@ 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:
			/* don't need to increment on the first iteration */
			if (inserted_requests)
				sector += seq_sector_delta;
			break;
		case  UFS_TEST_LONG_RANDOM_READ: