Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1be4e520 authored by Sahitya Tummala's avatar Sahitya Tummala
Browse files

mmc: block: support RPMB with CMDQ framework



CMDQ is not supported for RPMB partition. Hence, for RPMB requests
the controller is kept in HALT state and then CMDQ is disabled in
the card.

Change-Id: I1242841d5fa063b542e35dcff95694ef5e88737a
Signed-off-by: default avatarSahitya Tummala <stummala@codeaurora.org>
parent ad7fa3de
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -953,6 +953,8 @@ static int mmc_blk_cmdq_switch(struct mmc_card *card,
{
	int ret = 0;
	bool cmdq_mode = !!mmc_card_cmdq(card);
	struct mmc_host *host = card->host;
	struct mmc_cmdq_context_info *ctx = &host->cmdq_ctx;

	if (!(card->host->caps2 & MMC_CAP2_CMD_QUEUE) ||
	    !card->ext_csd.cmdq_support ||
@@ -967,6 +969,16 @@ static int mmc_blk_cmdq_switch(struct mmc_card *card,
			       __func__, ret, MMC_CARD_CMDQ_BLK_SIZE);
			goto out;
		}

	} else {
		if (!test_bit(CMDQ_STATE_HALT, &ctx->curr_state)) {
			ret = mmc_cmdq_halt(host, true);
			if (ret) {
				pr_err("%s: halt: failed: %d\n",
					mmc_hostname(host), ret);
				goto out;
			}
		}
	}

	ret = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
+1 −1
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ static inline bool mmc_cmdq_should_pull_reqs(struct mmc_host *host,
{
	if (((req->cmd_flags & (REQ_FLUSH | REQ_DISCARD)) &&
			test_bit(CMDQ_STATE_DCMD_ACTIVE, &ctx->curr_state)) ||
			mmc_host_halt(host) ||
			(!host->card->part_curr && mmc_host_halt(host)) ||
			test_bit(CMDQ_STATE_ERR, &ctx->curr_state)) {
		pr_debug("%s: %s: skip pulling reqs: state: %lu\n",
			 mmc_hostname(host), __func__, ctx->curr_state);