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

Commit 85b2cc01 authored by Asutosh Das's avatar Asutosh Das
Browse files

mmc: sd: set card removed to true



Sometimes when the card is removed and a request
is in queue the resume fails. But there's no way
to inform the in-flight request that the card is
removed since the resume itself fails and rescan
is waiting for claim_host which was acquired by
the in-flight request.

This request percolates to platform driver which
sees that the pre-requisites to issue the request
are not met i.e. the clocks are OFF.
So it tries to dump the registers and results in a
NoC error.

Set the card removed when resume fails to avoid this
problem.

CRs-fixed: 2430862
Change-Id: I171ad435ec11c1212e6528592b8db43cd0171b11
Signed-off-by: default avatarAsutosh Das <asutoshd@codeaurora.org>
parent 5084762c
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -3431,8 +3431,14 @@ int mmc_resume_bus(struct mmc_host *host)
	spin_unlock_irqrestore(&host->lock, flags);

	mmc_bus_get(host);
	if (host->ops->get_cd)
	if (host->ops->get_cd) {
		card_present = host->ops->get_cd(host);
		if (!card_present) {
			pr_err("%s: Card removed - card_present:%d\n",
			       mmc_hostname(host), card_present);
			mmc_card_set_removed(host->card);
		}
	}

	if (host->bus_ops && !host->bus_dead && host->card && card_present) {
		mmc_power_up(host, host->card->ocr);
+14 −4
Original line number Diff line number Diff line
@@ -1376,11 +1376,21 @@ static int mmc_sd_resume(struct mmc_host *host)

	MMC_TRACE(host, "%s: Enter\n", __func__);
	err = _mmc_sd_resume(host);
	if (err) {
		pr_err("%s: sd resume err: %d\n", mmc_hostname(host), err);
		if (host->ops->get_cd && !host->ops->get_cd(host)) {
			err = -ENOMEDIUM;
			mmc_card_set_removed(host->card);
		}
	}

	if (err != -ENOMEDIUM) {
		pm_runtime_set_active(&host->card->dev);
		pm_runtime_mark_last_busy(&host->card->dev);
		pm_runtime_enable(&host->card->dev);
	MMC_TRACE(host, "%s: Exit err: %d\n", __func__, err);
	}

	MMC_TRACE(host, "%s: Exit err: %d\n", __func__, err);
	return err;
}