summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2010-10-14 14:37:27 -0700
committerZhang Jiejing <jiejing.zhang@freescale.com>2011-11-02 11:13:54 +0800
commit1807ee98b496e9bb275ec328917a3eeff2f41931 (patch)
tree4e18b2b429ccb5c3fb3d7cb1c7fd26c6f30ca53f
parent1a78d5d3711cb578e6390a66cb303fdc09a32e6a (diff)
mmc: Fix pm_notifier obeying deferred resume (part 2)
Skip mmc_detect_change() in PM_POST_SUSPEND if Manual resume is used Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
-rw-r--r--drivers/mmc/core/core.c10
-rw-r--r--include/linux/mmc/host.h1
2 files changed, 9 insertions, 2 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 5f167cad068f..4c64e5021a0a 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -991,11 +991,17 @@ static inline void mmc_bus_put(struct mmc_host *host)
int mmc_resume_bus(struct mmc_host *host)
{
+ unsigned long flags;
+
if (!mmc_bus_needs_resume(host))
return -EINVAL;
printk("%s: Starting deferred resume\n", mmc_hostname(host));
+ spin_lock_irqsave(&host->lock, flags);
host->bus_resume_flags &= ~MMC_BUSRESUME_NEEDS_RESUME;
+ host->rescan_disable = 0;
+ spin_unlock_irqrestore(&host->lock, flags);
+
mmc_bus_get(host);
if (host->bus_ops && !host->bus_dead) {
mmc_power_up(host);
@@ -1340,7 +1346,7 @@ int mmc_resume_host(struct mmc_host *host)
int err = 0;
mmc_bus_get(host);
- if (host->bus_resume_flags & MMC_BUSRESUME_MANUAL_RESUME) {
+ if (mmc_bus_manual_resume(host)) {
host->bus_resume_flags |= MMC_BUSRESUME_NEEDS_RESUME;
mmc_bus_put(host);
return 0;
@@ -1408,7 +1414,7 @@ int mmc_pm_notify(struct notifier_block *notify_block,
case PM_POST_HIBERNATION:
spin_lock_irqsave(&host->lock, flags);
- if (mmc_bus_needs_resume(host)) {
+ if (mmc_bus_manual_resume(host)) {
spin_unlock_irqrestore(&host->lock, flags);
break;
}
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index d427ef04d882..2223359cb48e 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -238,6 +238,7 @@ static inline void *mmc_priv(struct mmc_host *host)
#define mmc_classdev(x) (&(x)->class_dev)
#define mmc_hostname(x) (dev_name(&(x)->class_dev))
#define mmc_bus_needs_resume(host) ((host)->bus_resume_flags & MMC_BUSRESUME_NEEDS_RESUME)
+#define mmc_bus_manual_resume(host) ((host)->bus_resume_flags & MMC_BUSRESUME_MANUAL_RESUME)
static inline void mmc_set_bus_resume_policy(struct mmc_host *host, int manual)
{