Commit c4c8eeb4 authored by Vaibhav Bedia's avatar Vaibhav Bedia Committed by Chris Ball

mmc: omap_hsmmc: Pass on the suspend failure to the PM core

In some cases mmc_suspend_host() is not able to claim the
host and proceed with the suspend process. The core returns
-EBUSY to the host controller driver. Unfortunately, the
host controller driver does not pass on this information
to the PM core and hence the system suspend process continues.

	ret = mmc_suspend_host(host->mmc);
	if (ret) {
		host->suspended = 0;
		if (host->pdata->resume) {
			ret = host->pdata->resume(dev, host->slot_id);

The return status from mmc_suspend_host() is overwritten by return
status from host->pdata->resume. So the original return status is lost.

In these cases the MMC core gets to an unexpected state
during resume and multiple issues related to MMC crop up.
1. Host controller driver starts accessing the device registers
before the clocks are enabled which leads to a prefetch abort.
2. A file copy thread which was launched before suspend gets
stuck due to the host not being reclaimed during resume.

To avoid such problems pass on the -EBUSY status to the PM core
from the host controller driver. With this change, MMC core
suspend might still fail but it does not end up making the
system unusable. Suspend gets aborted and the user can try
suspending the system again.
Signed-off-by: default avatarVaibhav Bedia <vaibhav.bedia@ti.com>
Signed-off-by: default avatarHebbar, Gururaja <gururaja.hebbar@ti.com>
Acked-by: default avatarVenkatraman S <svenkatr@ti.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent 6bf2af8c
...@@ -2050,8 +2050,7 @@ static int omap_hsmmc_suspend(struct device *dev) ...@@ -2050,8 +2050,7 @@ static int omap_hsmmc_suspend(struct device *dev)
if (ret) { if (ret) {
host->suspended = 0; host->suspended = 0;
if (host->pdata->resume) { if (host->pdata->resume) {
ret = host->pdata->resume(dev, host->slot_id); if (host->pdata->resume(dev, host->slot_id))
if (ret)
dev_dbg(dev, "Unmask interrupt failed\n"); dev_dbg(dev, "Unmask interrupt failed\n");
} }
goto err; goto err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment