[PATCH 2/3] mmc: test: prepare sbc for preceding ACMD23 multiple block write

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Enable preceding ACMD23 for testing multiple block write for the
sd cards which don't claim to support CMD23.

Signed-off-by: Shawn Lin <shawn.lin@xxxxxxxxxxxxxx>
---

 drivers/mmc/core/mmc_test.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/mmc/core/mmc_test.c b/drivers/mmc/core/mmc_test.c
index 4788698..c941ba9 100644
--- a/drivers/mmc/core/mmc_test.c
+++ b/drivers/mmc/core/mmc_test.c
@@ -198,17 +198,26 @@ static void mmc_test_prepare_sbc(struct mmc_test_card *test,
 				 struct mmc_request *mrq, unsigned int blocks)
 {
 	struct mmc_card *card = test->card;
+	bool need_acmd23 = false;
 
 	if (!mrq->sbc || !mmc_host_cmd23(card->host) ||
 	    !mmc_test_card_cmd23(card) || !mmc_op_multi(mrq->cmd->opcode) ||
 	    (card->quirks & MMC_QUIRK_BLK_NO_CMD23)) {
+		need_acmd23 = mmc_card_sd(card) &&
+			      mrq->cmd->opcode == MMC_WRITE_MULTIPLE_BLOCK;
+		if (need_acmd23)
+			goto prepare_sbc;
+
 		mrq->sbc = NULL;
 		return;
 	}
 
+prepare_sbc:
 	mrq->sbc->opcode = MMC_SET_BLOCK_COUNT;
 	mrq->sbc->arg = blocks;
 	mrq->sbc->flags = MMC_RSP_R1 | MMC_CMD_AC;
+	if (need_acmd23)
+		mrq->sbc->flags |= MMC_CMD_SD_APP;
 }
 
 /*
-- 
1.9.1


--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux