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

Commit 9aab11ee authored by Veerabhadrarao Badiganti's avatar Veerabhadrarao Badiganti
Browse files

mmc: cmdq_hci: Remove runtime PM vote if request issuing fails



Remove the runtime PM vote if command-queue request processing fails.
Otherwise, in case command-queue request preparation fails,
the runtime PM votes go out of sync and sdhc platform device suspend
might get blocked.

Change-Id: Ibe95e1653f7558a7994b606922a1625b429d57f6
Signed-off-by: default avatarVeerabhadrarao Badiganti <vbadigan@codeaurora.org>
parent a8118139
Loading
Loading
Loading
Loading
+18 −2
Original line number Diff line number Diff line
@@ -806,7 +806,7 @@ static int cmdq_request(struct mmc_host *mmc, struct mmc_request *mrq)
			mmc->err_stats[MMC_ERR_ICE_CFG]++;
			pr_err("%s: failed to configure crypto: err %d tag %d\n",
					mmc_hostname(mmc), err, tag);
			goto out;
			goto ice_err;
		}
	}

@@ -824,7 +824,7 @@ static int cmdq_request(struct mmc_host *mmc, struct mmc_request *mrq)
	if (err) {
		pr_err("%s: %s: failed to setup tx desc: %d\n",
		       mmc_hostname(mmc), __func__, err);
		goto out;
		goto desc_err;
	}

	cq_host->mrq_slot[tag] = mrq;
@@ -844,6 +844,22 @@ static int cmdq_request(struct mmc_host *mmc, struct mmc_request *mrq)
	/* Commit the doorbell write immediately */
	wmb();

	return err;

desc_err:
	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);
ice_err:
	if (err)
		cmdq_runtime_pm_put(cq_host);
out:
	return err;
}