diff options
author | Dmitry Shmidt <dimitrysh@google.com> | 2011-12-09 13:20:59 -0800 |
---|---|---|
committer | Dmitry Shmidt <dimitrysh@google.com> | 2011-12-09 13:30:43 -0800 |
commit | 3484c3ebe12163a54ec18af429112dfeafe2a4d6 (patch) | |
tree | 947fc693157055500ed682fca651c15a571ff1dc | |
parent | 6163711bce716fc63dcda986bdf57c3e2dc2d1a3 (diff) | |
download | kernel_samsung_tuna-3484c3ebe12163a54ec18af429112dfeafe2a4d6.zip kernel_samsung_tuna-3484c3ebe12163a54ec18af429112dfeafe2a4d6.tar.gz kernel_samsung_tuna-3484c3ebe12163a54ec18af429112dfeafe2a4d6.tar.bz2 |
mmc: omap_hsmmc: Call mmc_host_enable() in suspend only on success path
Suspend failure means active sd/mmc device that is in the middle of bus
access, and calling mmc_host_enable() in this case may have race condition
when host->mmc->ops->enable() will not be called, but host->mmc->ops->disable()
will be called and it will prevent device from talking to mmc controller.
Warning: Previous behavior to have mmc_host_enable() on failure path
during host->pdata->resume() is changed.
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
-rw-r--r-- | drivers/mmc/host/omap_hsmmc.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index d72fd1f..cd67c55 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -2313,8 +2313,8 @@ static int omap_hsmmc_suspend(struct device *dev) } cancel_work_sync(&host->mmc_carddetect_work); ret = mmc_suspend_host(host->mmc); - mmc_host_enable(host->mmc); if (ret == 0) { + mmc_host_enable(host->mmc); omap_hsmmc_disable_irq(host); OMAP_HSMMC_WRITE(host->base, HCTL, OMAP_HSMMC_READ(host->base, HCTL) & ~SDBP); @@ -2331,13 +2331,6 @@ static int omap_hsmmc_suspend(struct device *dev) dev_dbg(mmc_dev(host->mmc), "Unmask interrupt failed\n"); } - - /* - * Directly call platform_bus suspend. runtime PM - * PM lock is held during system suspend, so will - * not be auto-matically called - */ - mmc_host_disable(host->mmc); } } |