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

Commit f0903616 authored by Asutosh Das's avatar Asutosh Das Committed by Ram Prakash Gupta
Browse files

mmc: sd: Set card state to removed upon ejection



When the SD card is removed there's a detect
work that may or may not run immediately.
In the meantime if a request is issued, then
runtime_resume would pass without actually resuming
the card. Runtime-suspend turns-off the clocks too.

Thus writing to controller registers without resuming
causes the NOC error.

Fix this by setting the appropriate card state in resume.

CRs-fixed: 2452075
Change-Id: I70737c2b355ccf7a7c5e89130d57b458c1a7365b
Signed-off-by: default avatarAsutosh Das <asutoshd@codeaurora.org>
parent 58a29f2e
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -1304,6 +1304,7 @@ static int _mmc_sd_resume(struct mmc_host *host)
		goto out;

	if (host->ops->get_cd && !host->ops->get_cd(host)) {
		err = -ENOMEDIUM;
		mmc_card_clr_suspended(host->card);
		goto out;
	}
@@ -1429,14 +1430,16 @@ static int mmc_sd_runtime_suspend(struct mmc_host *host)
 */
static int mmc_sd_runtime_resume(struct mmc_host *host)
{
	int err;
	int err = 0;

	err = _mmc_sd_resume(host);
	if (err && err != -ENOMEDIUM)
	if (err) {
		pr_err("%s: error %d doing runtime resume\n",
			mmc_hostname(host), err);

	return 0;
		if (err == -ENOMEDIUM)
			mmc_card_set_removed(host->card);
	}
	return err;
}

static int mmc_sd_hw_reset(struct mmc_host *host)