@@ -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;
}
/*
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@rock-chips.com> --- Changes in v2: None drivers/mmc/core/mmc_test.c | 9 +++++++++ 1 file changed, 9 insertions(+)