Skip to contentSkip to conversation

mmc: card: Add Sanitize unit test

PATCH New Maya Erez 1 participant 1 message Jul 25, 2012

Subsystems (3)
lore
Share & tools
lore

Maya Erez

author
#0 lore raw

PATCH 1/1 mmc: card: Add Sanitize unit test

This test write data to the card, then send DISCARD on random addresses on the card, send SANITIZE to the card to erase all the unmapped areas.

---
This patch depends of the following patches:
[PATCH RESEND v7 1/2] block: ioctl support for sanitize in eMMC 4.5 [PATCH RESEND v7 2/2] mmc: card: Adding support for sanitize in eMMC 4.5 [PATCH v4 2/3] block: Add test-iosched scheduler
[PATCH v4 3/3] mmc: card: Add eMMC4.5 write packed commands unit-tests

---
 block/test-iosched.c              |    3 +
 drivers/mmc/card/mmc_block_test.c |  120 +++++++++++++++++++++++++++++++++++++
 include/linux/test-iosched.h      |    1 +
 3 files changed, 124 insertions(+), 0 deletions(-)
block/test-iosched.c +3 -0
index 6f0b0b3..e04befd 100644
@@ -173,6 +173,9 @@ int test_iosched_add_unique_test_req(int is_err_expcted,
 		bio->bi_size = nr_sects << 9;
 		bio->bi_sector = start_sec;
 		break;
+	case REQ_UNIQUE_SANITIZE:
+		bio->bi_rw = REQ_WRITE | REQ_SANITIZE;
+		break;
 	default:
 		test_pr_err("%s: Invalid request type %d", __func__,
 			    req_unique);
drivers/mmc/card/mmc_block_test.c +120 -0

173 lines not on this page · raw message

include/linux/test-iosched.h +1 -0
index 8054409..1e428c5 100644
@@ -65,6 +65,7 @@ enum req_unique_type {
 	REQ_UNIQUE_NONE,
 	REQ_UNIQUE_DISCARD,
 	REQ_UNIQUE_FLUSH,
+	REQ_UNIQUE_SANITIZE,
 };
 
 /**
Signature · 4 lines
1.7.3.3
-- 
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum