diff options
author | Balaji T K <balajitk@ti.com> | 2012-08-16 10:46:24 -0700 |
---|---|---|
committer | Dmitry Shmidt <dimitrysh@google.com> | 2012-08-16 11:29:31 -0700 |
commit | 392f3a36736547fb8a53c871217be1025110b013 (patch) | |
tree | 1bec40566f603ec231accf4154160c710684b95a /drivers/mmc/host | |
parent | a15bf22cba9eec27a008331c4b8a095fc43ea6b7 (diff) | |
download | kernel_samsung_tuna-392f3a36736547fb8a53c871217be1025110b013.zip kernel_samsung_tuna-392f3a36736547fb8a53c871217be1025110b013.tar.gz kernel_samsung_tuna-392f3a36736547fb8a53c871217be1025110b013.tar.bz2 |
OMAP4: hsmmc: fix race conditions in suspend/resume path
This reverts commit a15bf22cba9eec27a008331c4b8a095fc43ea6b7.
Change-Id: I92f37aaa0a5b323b229c2e51b4176f837a5e1494
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r-- | drivers/mmc/host/omap_hsmmc.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 046448d..86cb564 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -2296,6 +2296,8 @@ static int omap_hsmmc_suspend(struct device *dev) return 0; if (host) { + pm_runtime_get_sync(host->dev); + host->suspended = 1; if (host->pdata->suspend) { ret = host->pdata->suspend(&pdev->dev, @@ -2305,17 +2307,16 @@ static int omap_hsmmc_suspend(struct device *dev) "Unable to handle MMC board" " level suspend\n"); host->suspended = 0; + pm_runtime_put_sync(host->dev); return ret; } } cancel_work_sync(&host->mmc_carddetect_work); ret = mmc_suspend_host(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); - mmc_host_disable(host->mmc); if (host->got_dbclk) clk_disable(host->dbclk); @@ -2330,6 +2331,7 @@ static int omap_hsmmc_suspend(struct device *dev) } } + pm_runtime_put_sync(host->dev); } return ret; } @@ -2345,9 +2347,7 @@ static int omap_hsmmc_resume(struct device *dev) return 0; if (host) { - if (mmc_host_enable(host->mmc) != 0) { - goto clk_en_err; - } + pm_runtime_get_sync(host->dev); if (host->got_dbclk) clk_enable(host->dbclk); @@ -2368,15 +2368,10 @@ static int omap_hsmmc_resume(struct device *dev) if (ret == 0) host->suspended = 0; - mmc_host_lazy_disable(host->mmc); + pm_runtime_put_sync(host->dev); } return ret; - -clk_en_err: - dev_dbg(mmc_dev(host->mmc), - "Failed to enable MMC clocks during resume\n"); - return ret; } #else |