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

Commit eee31939 authored by Konstantin Dorfman's avatar Konstantin Dorfman
Browse files

mmc: block: fix cmdq shutdown flow



This change fixes cmdq shutdown flow:
- claims host (since devfreq scaling context could race)
- holds clocks
- disables cmdq controller mode
- updates cmdq card state mode

Change-Id: Ie25664516f782812fe39fba574be50e44ece815c
Signed-off-by: default avatarKonstantin Dorfman <kdorfman@codeaurora.org>
parent c0d82232
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -2868,13 +2868,14 @@ static void mmc_blk_cmdq_shutdown(struct mmc_queue *mq)
	struct mmc_card *card = mq->card;
	struct mmc_host *host = card->host;

	mmc_get_card(card);
	mmc_host_clk_hold(host);
	err = mmc_cmdq_halt(host, true);
	if (err) {
		pr_err("%s: halt: failed: %d\n", __func__, err);
		return;
	}

	mmc_get_card(card);
	/* disable CQ mode in card */
	err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
			 EXT_CSD_CMDQ, 0,
@@ -2884,9 +2885,12 @@ static void mmc_blk_cmdq_shutdown(struct mmc_queue *mq)
		       __func__, err);
		goto out;
	} else {
		mmc_card_clr_cmdq(card);
		host->cmdq_ops->disable(host, false);
		host->card->cmdq_init = false;
	}
out:
	mmc_host_clk_release(host);
	mmc_put_card(card);
}