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

Commit e192a2bd authored by Ritesh Harjani's avatar Ritesh Harjani Committed by Gerrit - the friendly Code Review server
Browse files

mmc: mmc: Add clk_hold/release pair before caching host->ios



We need to add mmc_host_clk_hold/release pair before caching
host->ios. Since it may so happen that the clks are gated
while caching and thus in next CMD5 awake, changing clk back to
cached_ios->clk might give NOC error.

Change-Id: I32b8c1bbbd67b4daadaa85c3c01beab8ff1b7cb2
Signed-off-by: default avatarRitesh Harjani <riteshh@codeaurora.org>
parent a3df2e4c
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -2389,9 +2389,16 @@ static int _mmc_suspend(struct mmc_host *host, bool is_suspend)
		goto out;

	if (mmc_can_sleepawake(host)) {
		/*
		 * For caching host->ios to cached_ios we need to
		 * make sure that clocks are not gated otherwise
		 * cached_ios->clock will be 0.
		 */
		mmc_host_clk_hold(host);
		memcpy(&host->cached_ios, &host->ios, sizeof(host->cached_ios));
		mmc_cache_card_ext_csd(host);
		err = mmc_sleepawake(host, true);
		mmc_host_clk_release(host);
	} else if (!mmc_host_is_spi(host)) {
		err = mmc_deselect_cards(host);
	}