From ad7271f11eb79a9f9db595677642763f47d9db08 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Sat, 30 Jul 2011 22:51:57 +0800 Subject: [PATCH] Revert "mmc: core: Add deferred bus resume policy." This reverts commit 40594a00454a1771286d86a8b3230ae5dba1a875. Conflicts: include/linux/mmc/host.h --- drivers/mmc/core/core.c | 33 --------------------------------- include/linux/mmc/host.h | 17 +---------------- 2 files changed, 1 insertion(+), 49 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 80994cf10a36..08d08e4699e7 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -964,30 +964,6 @@ static inline void mmc_bus_put(struct mmc_host *host) spin_unlock_irqrestore(&host->lock, flags); } -int mmc_resume_bus(struct mmc_host *host) -{ - if (!mmc_bus_needs_resume(host)) - return -EINVAL; - - printk("%s: Starting deferred resume\n", mmc_hostname(host)); - host->bus_resume_flags &= ~MMC_BUSRESUME_NEEDS_RESUME; - mmc_bus_get(host); - if (host->bus_ops && !host->bus_dead) { - mmc_power_up(host); - BUG_ON(!host->bus_ops->resume); - host->bus_ops->resume(host); - } - - if (host->bus_ops->detect && !host->bus_dead) - host->bus_ops->detect(host); - - mmc_bus_put(host); - printk("%s: Deferred resume completed\n", mmc_hostname(host)); - return 0; -} - -EXPORT_SYMBOL(mmc_resume_bus); - /* * Assign a mmc bus handler to a host. Only one bus handler may control a * host at any given time. @@ -1274,9 +1250,6 @@ int mmc_suspend_host(struct mmc_host *host, pm_message_t state) { int err = 0; - if (mmc_bus_needs_resume(host)) - return 0; - if (host->caps & MMC_CAP_DISABLE) cancel_delayed_work(&host->disable); cancel_delayed_work(&host->detect); @@ -1318,12 +1291,6 @@ int mmc_resume_host(struct mmc_host *host) int err = 0; mmc_bus_get(host); - if (host->bus_resume_flags & MMC_BUSRESUME_MANUAL_RESUME) { - host->bus_resume_flags |= MMC_BUSRESUME_NEEDS_RESUME; - mmc_bus_put(host); - return 0; - } - if (host->bus_ops && !host->bus_dead) { mmc_power_up(host); mmc_select_voltage(host, host->ocr); diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 5cdeae691266..94710905ec2c 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -197,11 +197,7 @@ struct mmc_host { const struct mmc_bus_ops *bus_ops; /* current bus driver */ unsigned int bus_refs; /* reference counter */ - unsigned int bus_resume_flags; -#define MMC_BUSRESUME_MANUAL_RESUME (1 << 0) -#define MMC_BUSRESUME_NEEDS_RESUME (1 << 1) - - unsigned int re_initialized_flags; //in order to begin the rescan ; added by xbw@2011-04-07 + unsigned int re_initialized_flags; //in order to begin the rescan ; added by xbw@2011-04-07 unsigned int sdio_irqs; struct task_struct *sdio_irq_thread; @@ -250,17 +246,6 @@ static inline void *mmc_priv(struct mmc_host *host) #define mmc_dev(x) ((x)->parent) #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) - -static inline void mmc_set_bus_resume_policy(struct mmc_host *host, int manual) -{ - if (manual) - host->bus_resume_flags |= MMC_BUSRESUME_MANUAL_RESUME; - else - host->bus_resume_flags &= ~MMC_BUSRESUME_MANUAL_RESUME; -} - -extern int mmc_resume_bus(struct mmc_host *host); extern int mmc_suspend_host(struct mmc_host *, pm_message_t); extern int mmc_resume_host(struct mmc_host *); -- 2.34.1