[PATCH/RFC] MMC: remove unbalanced pm_runtime_suspend()

Guennadi Liakhovetski
2011-04-19T10:46:24Z

MMC bus PM operations implement a .runtime_idle() method, which calls
pm_runtime_suspend(), but this call is not balanced by a resume
counterpart, which causes problems with repeated card-plug and driver-load
cycles. Removing this method fixes the disbalance.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---

With this patch and with v2 of the MMCIF PM patch, that I'll be posting
shortly, I can load / unload the driver, insert and remove the card and
suspend and wake up the system multiple times and each time the full PM
cycle is performed, going down to the platform callbacks. However, it
might well be, that there's a more correct way to achieve the same.

diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
index 63667a8..44866a6 100644
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -158,15 +158,9 @@ static int mmc_runtime_resume(struct device *dev)
return mmc_power_restore_host(card->host);
}

-static int mmc_runtime_idle(struct device *dev)
-{
- return pm_runtime_suspend(dev);
-}
-
static const struct dev_pm_ops mmc_bus_pm_ops = {
.runtime_suspend = mmc_runtime_suspend,
.runtime_resume = mmc_runtime_resume,
- .runtime_idle = mmc_runtime_idle,
};

#define MMC_PM_OPS_PTR (&mmc_bus_pm_ops)