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

Commit 4cb52a56 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mmc: host: Reset sdhc-crypto engine only during error recovery"

parents 5e1a70b6 e9782e38
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2976,6 +2976,9 @@ static int mmc_reset(struct mmc_host *host)
		mmc_pwrseq_reset(host);
	}

	if (host->inlinecrypt_support)
		host->inlinecrypt_reset_needed = true;

	ret = mmc_init_card(host, host->card->ocr, host->card);
	if (ret) {
		pr_err("%s: %s: mmc_init_card failed (%d)\n",
+5 −6
Original line number Diff line number Diff line
@@ -317,8 +317,6 @@ static void sdhci_do_reset(struct sdhci_host *host, u8 mask)
		/* Resetting the controller clears many */
		host->preset_enabled = false;
	}
	if (host->is_crypto_en)
		host->crypto_reset_reqd = true;
}

static void sdhci_set_default_irqs(struct sdhci_host *host)
@@ -1838,14 +1836,15 @@ static int sdhci_crypto_cfg(struct sdhci_host *host, struct mmc_request *mrq,
{
	int err = 0;

	if (host->crypto_reset_reqd && host->ops->crypto_engine_reset) {
	if (host->mmc->inlinecrypt_reset_needed &&
			host->ops->crypto_engine_reset) {
		err = host->ops->crypto_engine_reset(host);
		if (err) {
			pr_err("%s: crypto reset failed\n",
					mmc_hostname(host->mmc));
			goto out;
		}
		host->crypto_reset_reqd = false;
		host->mmc->inlinecrypt_reset_needed = false;
	}

	if (host->ops->crypto_engine_cfg) {
@@ -4066,14 +4065,14 @@ static int sdhci_cmdq_crypto_cfg(struct mmc_host *mmc,
	if (!host->is_crypto_en)
		return 0;

	if (host->crypto_reset_reqd && host->ops->crypto_engine_reset) {
	if (mmc->inlinecrypt_reset_needed && host->ops->crypto_engine_reset) {
		err = host->ops->crypto_engine_reset(host);
		if (err) {
			pr_err("%s: crypto reset failed\n",
					mmc_hostname(host->mmc));
			goto out;
		}
		host->crypto_reset_reqd = false;
		mmc->inlinecrypt_reset_needed = false;
	}

	if (host->ops->crypto_engine_cmdq_cfg) {
+0 −1
Original line number Diff line number Diff line
@@ -654,7 +654,6 @@ struct sdhci_host {

	bool sdio_irq_async_status;
	bool is_crypto_en;
	bool crypto_reset_reqd;

	u32 auto_cmd_err_sts;
	struct ratelimit_state dbg_dump_rs;
+1 −0
Original line number Diff line number Diff line
@@ -710,6 +710,7 @@ struct mmc_host {
	struct mmc_request	*err_mrq;

	bool inlinecrypt_support;  /* Inline encryption support */
	bool inlinecrypt_reset_needed;  /* Inline crypto reset */

	atomic_t rpmb_req_pending;
	struct mutex		rpmb_req_mutex;