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

Commit 57056d5b authored by Veerabhadrarao Badiganti's avatar Veerabhadrarao Badiganti
Browse files

mmc: host: cmdq-hci-ice: Clear ICE configuration once request is done



Clear ICE configuration once cmdq request processing is done.
This ensures that the key information is cleared by ICE driver.
This call is optional for FDE but required for FBE.

Change-Id: I231ca849aa34c156baa45fceae95debf46dd57f0
Signed-off-by: default avatarVeerabhadrarao Badiganti <vbadigan@codeaurora.org>
parent 6c6b97a7
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -852,6 +852,7 @@ static void cmdq_finish_data(struct mmc_host *mmc, unsigned int tag)
	struct mmc_request *mrq;
	struct cmdq_host *cq_host = (struct cmdq_host *)mmc_cmdq_private(mmc);
	int offset = 0;
	int err = 0;

	if (cq_host->offset_changed)
		offset = CQ_V5_VENDOR_CFG;
@@ -865,6 +866,14 @@ static void cmdq_finish_data(struct mmc_host *mmc, unsigned int tag)
			CMDQ_SEND_STATUS_TRIGGER, CQ_VENDOR_CFG + offset);

	cmdq_runtime_pm_put(cq_host);

	if (cq_host->ops->crypto_cfg_end) {
		err = cq_host->ops->crypto_cfg_end(mmc, mrq);
		if (err) {
			pr_err("%s: failed to end ice config: err %d tag %d\n",
					mmc_hostname(mmc), err, tag);
		}
	}
	if (!(cq_host->caps & CMDQ_CAP_CRYPTO_SUPPORT) &&
			cq_host->ops->crypto_cfg_reset)
		cq_host->ops->crypto_cfg_reset(mmc, tag);
+1 −0
Original line number Diff line number Diff line
@@ -224,6 +224,7 @@ struct cmdq_host_ops {
	void (*post_cqe_halt)(struct mmc_host *mmc);
	int (*crypto_cfg)(struct mmc_host *mmc, struct mmc_request *mrq,
				u32 slot, u64 *ice_ctx);
	int (*crypto_cfg_end)(struct mmc_host *mmc, struct mmc_request *mrq);
	void (*crypto_cfg_reset)(struct mmc_host *mmc, unsigned int slot);
};

+18 −0
Original line number Diff line number Diff line
@@ -3823,6 +3823,17 @@ static int sdhci_cmdq_crypto_cfg(struct mmc_host *mmc,
	return err;
}

static int sdhci_cmdq_crypto_cfg_end(struct mmc_host *mmc,
					struct mmc_request *mrq)
{
	struct sdhci_host *host = mmc_priv(mmc);

	if (!host->is_crypto_en)
		return 0;

	return sdhci_crypto_cfg_end(host, mrq);
}

static void sdhci_cmdq_crypto_cfg_reset(struct mmc_host *mmc, unsigned int slot)
{
	struct sdhci_host *host = mmc_priv(mmc);
@@ -3885,6 +3896,12 @@ static int sdhci_cmdq_crypto_cfg(struct mmc_host *mmc,
	return 0;
}

static int sdhci_cmdq_crypto_cfg_end(struct mmc_host *mmc,
				struct mmc_request *mrq)
{
	return 0;
}

static void sdhci_cmdq_crypto_cfg_reset(struct mmc_host *mmc, unsigned int slot)
{

@@ -3901,6 +3918,7 @@ static const struct cmdq_host_ops sdhci_cmdq_ops = {
	.post_cqe_halt = sdhci_cmdq_post_cqe_halt,
	.set_transfer_params = sdhci_cmdq_set_transfer_params,
	.crypto_cfg	= sdhci_cmdq_crypto_cfg,
	.crypto_cfg_end	= sdhci_cmdq_crypto_cfg_end,
	.crypto_cfg_reset	= sdhci_cmdq_crypto_cfg_reset,
};