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

Commit 8e75e263 authored by Asutosh Das's avatar Asutosh Das
Browse files

mmc: core: Reset on error during deferred resume



If resume fails, there is no way to handle it now.
Also there's no attempt to recover from it.
This leads to lot of warnings while issuing requests.

Check for resume errors & reset the stack on error as
an attempt to recover from it.

Change-Id: Ie4d6d2a34c2c7a8154696e93d85e50d60410e0c2
Signed-off-by: default avatarAsutosh Das <asutoshd@codeaurora.org>
parent eb1480ce
Loading
Loading
Loading
Loading
+15 −4
Original line number Original line Diff line number Diff line
@@ -3239,20 +3239,31 @@ int mmc_resume_bus(struct mmc_host *host)
	if (host->bus_ops && !host->bus_dead && host->card) {
	if (host->bus_ops && !host->bus_dead && host->card) {
		mmc_power_up(host, host->card->ocr);
		mmc_power_up(host, host->card->ocr);
		BUG_ON(!host->bus_ops->resume);
		BUG_ON(!host->bus_ops->resume);
		host->bus_ops->resume(host);
		err = host->bus_ops->resume(host);
		if (err) {
			pr_err("%s: bus resume: failed: %d\n",
			       mmc_hostname(host), err);
			err = mmc_hw_reset(host);
			if (err) {
				pr_err("%s: reset: failed: %d\n",
				       mmc_hostname(host), err);
				goto err_reset;
			} else {
				mmc_card_clr_suspended(host->card);
			}
		}
		if (mmc_card_cmdq(host->card)) {
		if (mmc_card_cmdq(host->card)) {
			err = mmc_cmdq_halt(host, false);
			err = mmc_cmdq_halt(host, false);
			if (err)
			if (err)
				pr_err("%s: %s: unhalt failed: %d\n",
				pr_err("%s: %s: unhalt failed: %d\n",
				       mmc_hostname(host), __func__, err);
				       mmc_hostname(host), __func__, err);
			else
				mmc_card_clr_suspended(host->card);
		}
		}
	}
	}


err_reset:
	mmc_bus_put(host);
	mmc_bus_put(host);
	pr_debug("%s: Deferred resume completed\n", mmc_hostname(host));
	pr_debug("%s: Deferred resume completed\n", mmc_hostname(host));
	return 0;
	return err;
}
}
EXPORT_SYMBOL(mmc_resume_bus);
EXPORT_SYMBOL(mmc_resume_bus);