aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2016-02-23 13:01:53 -0800
committerDmitry Shmidt <dimitrysh@google.com>2016-02-23 13:01:53 -0800
commit45f08da5f55fc3f85fa0bc8148e4d993f3017f2a (patch)
tree554b1c50ee3fa84813d07c3adbdde1e79266a29a
parent52cca7009d6dfedd490779e93fb80af4efbf55a1 (diff)
downloadhikey-linaro-45f08da5f55fc3f85fa0bc8148e4d993f3017f2a.tar.gz
Revert "mmc: core: Hold a wake lock accross delayed work + mmc rescan"
Patch mmc: core: Signal wakeup event at card insert/removal provides wake lock for mmc_detect_change() This reverts commit bdbc5cfe7c034175466285da10d4b2a84addd9c3.
-rw-r--r--drivers/mmc/core/core.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 5da8515b8660..c731dc4b4664 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -29,7 +29,6 @@
#include <linux/random.h>
#include <linux/slab.h>
#include <linux/of.h>
-#include <linux/wakelock.h>
#include <trace/events/mmc.h>
@@ -59,7 +58,6 @@
#define MMC_BKOPS_MAX_TIMEOUT (4 * 60 * 1000) /* max time to wait in ms */
static struct workqueue_struct *workqueue;
-static struct wake_lock mmc_delayed_work_wake_lock;
static const unsigned freqs[] = { 400000, 300000, 200000, 100000 };
/*
@@ -76,7 +74,6 @@ module_param(use_spi_crc, bool, 0);
static int mmc_schedule_delayed_work(struct delayed_work *work,
unsigned long delay)
{
- wake_lock(&mmc_delayed_work_wake_lock);
return queue_delayed_work(workqueue, work, delay);
}
@@ -2464,7 +2461,6 @@ void mmc_rescan(struct work_struct *work)
struct mmc_host *host =
container_of(work, struct mmc_host, detect.work);
int i;
- bool extend_wakelock = false;
if (host->trigger_card_event && host->ops->card_event) {
host->ops->card_event(host);
@@ -2526,20 +2522,14 @@ void mmc_rescan(struct work_struct *work)
mmc_claim_host(host);
for (i = 0; i < ARRAY_SIZE(freqs); i++) {
- if (!mmc_rescan_try_freq(host, max(freqs[i], host->f_min))) {
- extend_wakelock = true;
+ if (!mmc_rescan_try_freq(host, max(freqs[i], host->f_min)))
break;
- }
if (freqs[i] <= host->f_min)
break;
}
mmc_release_host(host);
out:
- if (extend_wakelock)
- wake_lock_timeout(&mmc_delayed_work_wake_lock, HZ / 2);
- else
- wake_unlock(&mmc_delayed_work_wake_lock);
if (host->caps & MMC_CAP_NEEDS_POLL)
mmc_schedule_delayed_work(&host->detect, HZ);
}
@@ -2761,9 +2751,6 @@ static int __init mmc_init(void)
if (!workqueue)
return -ENOMEM;
- wake_lock_init(&mmc_delayed_work_wake_lock, WAKE_LOCK_SUSPEND,
- "mmc_delayed_work");
-
ret = mmc_register_bus();
if (ret)
goto destroy_workqueue;
@@ -2784,7 +2771,6 @@ unregister_bus:
mmc_unregister_bus();
destroy_workqueue:
destroy_workqueue(workqueue);
- wake_lock_destroy(&mmc_delayed_work_wake_lock);
return ret;
}
@@ -2795,7 +2781,6 @@ static void __exit mmc_exit(void)
mmc_unregister_host_class();
mmc_unregister_bus();
destroy_workqueue(workqueue);
- wake_lock_destroy(&mmc_delayed_work_wake_lock);
}
subsys_initcall(mmc_init);