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

Commit 8b96d7f4 authored by Sahitya Tummala's avatar Sahitya Tummala
Browse files

mmc: block: Fix issue with deferred resume when CQ is enabled



In CQ mode, the legacy commands will be sent after CQ is
put in halt state. But when deferred resume is enabled,
the resume happens in mmc_wait_for_req(), which will enable
CQ again overiding the caller's state. This causes legacy
commands to fail. Fix this by moving the deferred resume
from all the places to mmc_get_card() which is always the
first step done in both CQ/legacy commands and thus avoids
the above issue scneario.

Change-Id: I432e89f3221615dd644412f481d17f840c75e407
Signed-off-by: default avatarSahitya Tummala <stummala@codeaurora.org>
parent b17afbac
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -3490,10 +3490,6 @@ static int mmc_blk_cmdq_issue_rq(struct mmc_queue *mq, struct request *req)

	mmc_get_card(card);

#ifdef CONFIG_MMC_BLOCK_DEFERRED_RESUME
	if (mmc_bus_needs_resume(card->host))
		mmc_resume_bus(card->host);
#endif
	if (!card->host->cmdq_ctx.active_reqs && mmc_card_doing_bkops(card)) {
		ret = mmc_cmdq_halt(card->host, true);
		if (ret)
@@ -3580,10 +3576,6 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
		/* claim host only for the first request */
		mmc_get_card(card);

#ifdef CONFIG_MMC_BLOCK_DEFERRED_RESUME
	if (mmc_bus_needs_resume(card->host))
		mmc_resume_bus(card->host);
#endif
		if (mmc_card_doing_bkops(host->card)) {
			ret = mmc_stop_bkops(host->card);
			if (ret)
+4 −4
Original line number Diff line number Diff line
@@ -1646,10 +1646,6 @@ EXPORT_SYMBOL(mmc_start_req);
 */
void mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq)
{
#ifdef CONFIG_MMC_BLOCK_DEFERRED_RESUME
	if (mmc_bus_needs_resume(host))
		mmc_resume_bus(host);
#endif
	__mmc_start_req(host, mrq);
	mmc_wait_for_req_done(host, mrq);
}
@@ -2046,6 +2042,10 @@ void mmc_get_card(struct mmc_card *card)
{
	pm_runtime_get_sync(&card->dev);
	mmc_claim_host(card->host);
#ifdef CONFIG_MMC_BLOCK_DEFERRED_RESUME
	if (mmc_bus_needs_resume(card->host))
		mmc_resume_bus(card->host);
#endif
}
EXPORT_SYMBOL(mmc_get_card);