浏览代码

mmc_test: Revert "mmc_test: test oversized sg lists"

This reverts commit 48b5352ea1891455eb8e824cf7d92f66931a090f. Oversized
sg lists are not allowed anymore, and the core even checks for them in
debug mode, so this test is entirely incorrect.

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Pierre Ossman 17 年之前
父节点
当前提交
b7ac2cf1cd
共有 1 个文件被更改,包括 3 次插入82 次删除
  1. 3 82
      drivers/mmc/card/mmc_test.c

+ 3 - 82
drivers/mmc/card/mmc_test.c

@@ -388,16 +388,14 @@ static int mmc_test_transfer(struct mmc_test_card *test,
 	int ret, i;
 	int ret, i;
 	unsigned long flags;
 	unsigned long flags;
 
 
-	BUG_ON(blocks * blksz > BUFFER_SIZE);
-
 	if (write) {
 	if (write) {
 		for (i = 0;i < blocks * blksz;i++)
 		for (i = 0;i < blocks * blksz;i++)
 			test->scratch[i] = i;
 			test->scratch[i] = i;
 	} else {
 	} else {
-		memset(test->scratch, 0, blocks * blksz);
+		memset(test->scratch, 0, BUFFER_SIZE);
 	}
 	}
 	local_irq_save(flags);
 	local_irq_save(flags);
-	sg_copy_from_buffer(sg, sg_len, test->scratch, blocks * blksz);
+	sg_copy_from_buffer(sg, sg_len, test->scratch, BUFFER_SIZE);
 	local_irq_restore(flags);
 	local_irq_restore(flags);
 
 
 	ret = mmc_test_set_blksize(test, blksz);
 	ret = mmc_test_set_blksize(test, blksz);
@@ -444,7 +442,7 @@ static int mmc_test_transfer(struct mmc_test_card *test,
 		}
 		}
 	} else {
 	} else {
 		local_irq_save(flags);
 		local_irq_save(flags);
-		sg_copy_to_buffer(sg, sg_len, test->scratch, blocks * blksz);
+		sg_copy_to_buffer(sg, sg_len, test->scratch, BUFFER_SIZE);
 		local_irq_restore(flags);
 		local_irq_restore(flags);
 		for (i = 0;i < blocks * blksz;i++) {
 		for (i = 0;i < blocks * blksz;i++) {
 			if (test->scratch[i] != (u8)i)
 			if (test->scratch[i] != (u8)i)
@@ -805,69 +803,6 @@ static int mmc_test_multi_xfersize_read(struct mmc_test_card *test)
 	return 0;
 	return 0;
 }
 }
 
 
-static int mmc_test_bigsg_write(struct mmc_test_card *test)
-{
-	int ret;
-	unsigned int size;
-	struct scatterlist sg;
-
-	if (test->card->host->max_blk_count == 1)
-		return RESULT_UNSUP_HOST;
-
-	size = PAGE_SIZE * 2;
-	size = min(size, test->card->host->max_req_size);
-	size = min(size, test->card->host->max_seg_size);
-	size = min(size, test->card->host->max_blk_count * 512);
-
-	memset(test->buffer, 0, BUFFER_SIZE);
-
-	if (size < 1024)
-		return RESULT_UNSUP_HOST;
-
-	sg_init_table(&sg, 1);
-	sg_init_one(&sg, test->buffer, BUFFER_SIZE);
-
-	ret = mmc_test_transfer(test, &sg, 1, 0, size/512, 512, 1);
-	if (ret)
-		return ret;
-
-	return 0;
-}
-
-static int mmc_test_bigsg_read(struct mmc_test_card *test)
-{
-	int ret, i;
-	unsigned int size;
-	struct scatterlist sg;
-
-	if (test->card->host->max_blk_count == 1)
-		return RESULT_UNSUP_HOST;
-
-	size = PAGE_SIZE * 2;
-	size = min(size, test->card->host->max_req_size);
-	size = min(size, test->card->host->max_seg_size);
-	size = min(size, test->card->host->max_blk_count * 512);
-
-	if (size < 1024)
-		return RESULT_UNSUP_HOST;
-
-	memset(test->buffer, 0xCD, BUFFER_SIZE);
-
-	sg_init_table(&sg, 1);
-	sg_init_one(&sg, test->buffer, BUFFER_SIZE);
-	ret = mmc_test_transfer(test, &sg, 1, 0, size/512, 512, 0);
-	if (ret)
-		return ret;
-
-	/* mmc_test_transfer() doesn't check for read overflows */
-	for (i = size;i < BUFFER_SIZE;i++) {
-		if (test->buffer[i] != 0xCD)
-			return RESULT_FAIL;
-	}
-
-	return 0;
-}
-
 #ifdef CONFIG_HIGHMEM
 #ifdef CONFIG_HIGHMEM
 
 
 static int mmc_test_write_high(struct mmc_test_card *test)
 static int mmc_test_write_high(struct mmc_test_card *test)
@@ -1071,20 +1006,6 @@ static const struct mmc_test_case mmc_test_cases[] = {
 		.run = mmc_test_multi_xfersize_read,
 		.run = mmc_test_multi_xfersize_read,
 	},
 	},
 
 
-	{
-		.name = "Over-sized SG list write",
-		.prepare = mmc_test_prepare_write,
-		.run = mmc_test_bigsg_write,
-		.cleanup = mmc_test_cleanup,
-	},
-
-	{
-		.name = "Over-sized SG list read",
-		.prepare = mmc_test_prepare_read,
-		.run = mmc_test_bigsg_read,
-		.cleanup = mmc_test_cleanup,
-	},
-
 #ifdef CONFIG_HIGHMEM
 #ifdef CONFIG_HIGHMEM
 
 
 	{
 	{