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: Asutosh Das <asutoshd@codeaurora.org>
This commit is contained in:
parent
eb1480ce5a
commit
8e75e263e6
1 changed files with 15 additions and 4 deletions
|
@ -3239,20 +3239,31 @@ int mmc_resume_bus(struct mmc_host *host)
|
|||
if (host->bus_ops && !host->bus_dead && host->card) {
|
||||
mmc_power_up(host, host->card->ocr);
|
||||
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)) {
|
||||
err = mmc_cmdq_halt(host, false);
|
||||
if (err)
|
||||
pr_err("%s: %s: unhalt failed: %d\n",
|
||||
mmc_hostname(host), __func__, err);
|
||||
else
|
||||
mmc_card_clr_suspended(host->card);
|
||||
}
|
||||
}
|
||||
|
||||
err_reset:
|
||||
mmc_bus_put(host);
|
||||
pr_debug("%s: Deferred resume completed\n", mmc_hostname(host));
|
||||
return 0;
|
||||
return err;
|
||||
}
|
||||
EXPORT_SYMBOL(mmc_resume_bus);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue