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

Commit 7f5e93a4 authored by Vijay Viswanath's avatar Vijay Viswanath
Browse files

mmc: block: Disable clock scaling during shutdown



During shutdown of sdhc drivers, power off notification (PON) is sent
to eMMC device. But it doesn't prevent the clock scaling framework
from kicking in and sending commands to card after PON is sent. So
exit clock scaling framework of sdhc before PON is sent.

Change-Id: Ibfe097732042458965db529f235a7fd28cfabaab
Signed-off-by: default avatarVijay Viswanath <vviswana@codeaurora.org>
parent 450552a6
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -4664,10 +4664,6 @@ static int _mmc_blk_suspend(struct mmc_card *card, bool wait)
static void mmc_blk_shutdown(struct mmc_card *card)
{
	_mmc_blk_suspend(card, 1);

	/* send power off notification */
	if (mmc_card_mmc(card))
		mmc_send_pon(card);
}

#ifdef CONFIG_PM_SLEEP
+17 −0
Original line number Diff line number Diff line
@@ -2983,6 +2983,22 @@ static int mmc_reset(struct mmc_host *host)
	return mmc_init_card(host, card->ocr, card);
}

static int mmc_shutdown(struct mmc_host *host)
{
	struct mmc_card *card = host->card;

	/*
	 * Exit clock scaling so that it doesn't kick in after
	 * power off notification is sent
	 */
	if (host->caps2 & MMC_CAP2_CLK_SCALE)
		mmc_exit_clk_scaling(card->host);
	/* send power off notification */
	if (mmc_card_mmc(card))
		mmc_send_pon(card);
	return 0;
}

static const struct mmc_bus_ops mmc_ops = {
	.remove = mmc_remove,
	.detect = mmc_detect,
@@ -2993,6 +3009,7 @@ static const struct mmc_bus_ops mmc_ops = {
	.alive = mmc_alive,
	.change_bus_speed = mmc_change_bus_speed,
	.reset = mmc_reset,
	.shutdown = mmc_shutdown,
};

/*