diff options
author | Saugata Das <saugata.das@linaro.org> | 2011-12-21 02:39:17 -0500 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2012-03-25 19:33:44 -0400 |
commit | 4265900e0be653f5b78baf2816857ef57cf1332f (patch) | |
tree | 156dc60c8f5b24aa0c8be7d18759faae6ecff5f7 /drivers/mmc/card/block.c | |
parent | e2a0883e4071237d09b604a342c28b96b44a04b3 (diff) |
mmc: MMC-4.5 Data Tag Support
MMC-4.5 data tag feature will be used to store the file system meta-data
in the tagged region of eMMC. This will improve the write and subsequent
read transfer time for the meta data.
Signed-off-by: Saugata Das <saugata.das@linaro.org>
Tested-by: Venkatraman S <svenkatr@ti.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/card/block.c')
-rw-r--r-- | drivers/mmc/card/block.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index e5a3c7b6dedb..f2020d37c658 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c | |||
@@ -1080,6 +1080,7 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq, | |||
1080 | struct mmc_blk_request *brq = &mqrq->brq; | 1080 | struct mmc_blk_request *brq = &mqrq->brq; |
1081 | struct request *req = mqrq->req; | 1081 | struct request *req = mqrq->req; |
1082 | struct mmc_blk_data *md = mq->data; | 1082 | struct mmc_blk_data *md = mq->data; |
1083 | bool do_data_tag; | ||
1083 | 1084 | ||
1084 | /* | 1085 | /* |
1085 | * Reliable writes are used to implement Forced Unit Access and | 1086 | * Reliable writes are used to implement Forced Unit Access and |
@@ -1156,6 +1157,16 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq, | |||
1156 | mmc_apply_rel_rw(brq, card, req); | 1157 | mmc_apply_rel_rw(brq, card, req); |
1157 | 1158 | ||
1158 | /* | 1159 | /* |
1160 | * Data tag is used only during writing meta data to speed | ||
1161 | * up write and any subsequent read of this meta data | ||
1162 | */ | ||
1163 | do_data_tag = (card->ext_csd.data_tag_unit_size) && | ||
1164 | (req->cmd_flags & REQ_META) && | ||
1165 | (rq_data_dir(req) == WRITE) && | ||
1166 | ((brq->data.blocks * brq->data.blksz) >= | ||
1167 | card->ext_csd.data_tag_unit_size); | ||
1168 | |||
1169 | /* | ||
1159 | * Pre-defined multi-block transfers are preferable to | 1170 | * Pre-defined multi-block transfers are preferable to |
1160 | * open ended-ones (and necessary for reliable writes). | 1171 | * open ended-ones (and necessary for reliable writes). |
1161 | * However, it is not sufficient to just send CMD23, | 1172 | * However, it is not sufficient to just send CMD23, |
@@ -1173,13 +1184,13 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq, | |||
1173 | * We'll avoid using CMD23-bounded multiblock writes for | 1184 | * We'll avoid using CMD23-bounded multiblock writes for |
1174 | * these, while retaining features like reliable writes. | 1185 | * these, while retaining features like reliable writes. |
1175 | */ | 1186 | */ |
1176 | 1187 | if ((md->flags & MMC_BLK_CMD23) && mmc_op_multi(brq->cmd.opcode) && | |
1177 | if ((md->flags & MMC_BLK_CMD23) && | 1188 | (do_rel_wr || !(card->quirks & MMC_QUIRK_BLK_NO_CMD23) || |
1178 | mmc_op_multi(brq->cmd.opcode) && | 1189 | do_data_tag)) { |
1179 | (do_rel_wr || !(card->quirks & MMC_QUIRK_BLK_NO_CMD23))) { | ||
1180 | brq->sbc.opcode = MMC_SET_BLOCK_COUNT; | 1190 | brq->sbc.opcode = MMC_SET_BLOCK_COUNT; |
1181 | brq->sbc.arg = brq->data.blocks | | 1191 | brq->sbc.arg = brq->data.blocks | |
1182 | (do_rel_wr ? (1 << 31) : 0); | 1192 | (do_rel_wr ? (1 << 31) : 0) | |
1193 | (do_data_tag ? (1 << 29) : 0); | ||
1183 | brq->sbc.flags = MMC_RSP_R1 | MMC_CMD_AC; | 1194 | brq->sbc.flags = MMC_RSP_R1 | MMC_CMD_AC; |
1184 | brq->mrq.sbc = &brq->sbc; | 1195 | brq->mrq.sbc = &brq->sbc; |
1185 | } | 1196 | } |