aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2015-11-17 16:11:10 +0100
committerUlf Hansson <ulf.hansson@linaro.org>2015-11-27 15:47:57 +0100
commitf09c6168692575714529e1717b96df7507cc8e46 (patch)
tree0d43c87bcd12a5be29563ad8290a4a67d83e9e01
parent222e0bfc1229865405ca7bbfe2c7be5fa6ad6e39 (diff)
mmc: core: Replace workqueue and notifiersdebug_workqueue
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r--drivers/mmc/core/core.c44
-rw-r--r--drivers/mmc/core/host.c4
2 files changed, 44 insertions, 4 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 910aa254f23a..ff4697105dbc 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -72,7 +72,9 @@ module_param(use_spi_crc, bool, 0);
static int mmc_schedule_delayed_work(struct delayed_work *work,
unsigned long delay)
{
- return queue_delayed_work(workqueue, work, delay);
+// return queue_delayed_work(workqueue, work, delay);
+// return queue_delayed_work(system_long_wq, work, delay);
+ return queue_delayed_work(system_freezable_wq, work, delay);
}
/*
@@ -2572,14 +2574,30 @@ void mmc_rescan(struct work_struct *work)
container_of(work, struct mmc_host, detect.work);
int i;
+ dev_err(mmc_dev(host), "%s ENTER 1\n", __func__);
+
if (host->rescan_disable)
return;
+#if 0
+ if (strcmp(dev_name(mmc_dev(host)), "80118000.sdi1_per2") == 0) {
+ dev_err(mmc_dev(host), "%s SLEEP 1\n", __func__);
+ msleep(5000);
+ dev_err(mmc_dev(host), "%s SLEEP 2\n", __func__);
+ msleep(20000);
+ dev_err(mmc_dev(host), "%s SLEEP DONE\n", __func__);
+ }
+#endif
+
+ dev_err(mmc_dev(host), "%s ENTER 2\n", __func__);
+
/* If there is a non-removable card registered, only scan once */
if ((host->caps & MMC_CAP_NONREMOVABLE) && host->rescan_entered)
return;
host->rescan_entered = 1;
+ dev_err(mmc_dev(host), "%s ENTER 3\n", __func__);
+
if (host->trigger_card_event && host->ops->card_event) {
mmc_claim_host(host);
host->ops->card_event(host);
@@ -2609,6 +2627,7 @@ void mmc_rescan(struct work_struct *work)
/* if there still is a card present, stop here */
if (host->bus_ops != NULL) {
mmc_bus_put(host);
+ dev_err(mmc_dev(host), "%s ENTER 4\n", __func__);
goto out;
}
@@ -2623,6 +2642,7 @@ void mmc_rescan(struct work_struct *work)
host->ops->get_cd(host) == 0) {
mmc_power_off(host);
mmc_release_host(host);
+ dev_err(mmc_dev(host), "%s ENTER 5\n", __func__);
goto out;
}
@@ -2635,6 +2655,19 @@ void mmc_rescan(struct work_struct *work)
mmc_release_host(host);
out:
+
+ if (strcmp(dev_name(mmc_dev(host)), "80126000.sdi0_per1") == 0) {
+ dev_err(mmc_dev(host), "%s SLEEP 20s\n", __func__);
+ msleep(20000);
+ dev_err(mmc_dev(host), "%s SLEEP DONE\n", __func__);
+ dev_err(mmc_dev(host), "%s **Schedule new work in 10s**\n", __func__);
+ mmc_schedule_delayed_work(&host->detect, msecs_to_jiffies(10000));
+ dev_err(mmc_dev(host), "%s **Schedule new work in 5s**\n", __func__);
+ mmc_schedule_delayed_work(&host->detect, msecs_to_jiffies(5000));
+ }
+
+ dev_err(mmc_dev(host), "%s END\n", __func__);
+
if (host->caps & MMC_CAP_NEEDS_POLL)
mmc_schedule_delayed_work(&host->detect, HZ);
}
@@ -2778,10 +2811,14 @@ static int mmc_pm_notify(struct notifier_block *notify_block,
unsigned long flags;
int err = 0;
+ if (!host->rescan_entered)
+ dev_err(mmc_dev(host), "** %s Rescan not entered yet\n", __func__);
+
switch (mode) {
case PM_HIBERNATION_PREPARE:
case PM_SUSPEND_PREPARE:
case PM_RESTORE_PREPARE:
+ dev_err(mmc_dev(host), "**** %s Prepare\n", __func__);
spin_lock_irqsave(&host->lock, flags);
host->rescan_disable = 1;
spin_unlock_irqrestore(&host->lock, flags);
@@ -2809,13 +2846,16 @@ static int mmc_pm_notify(struct notifier_block *notify_block,
case PM_POST_HIBERNATION:
case PM_POST_RESTORE:
+ dev_err(mmc_dev(host), "**** %s Restore\n", __func__);
+
spin_lock_irqsave(&host->lock, flags);
host->rescan_disable = 0;
spin_unlock_irqrestore(&host->lock, flags);
- _mmc_detect_change(host, 0, false);
+ //_mmc_detect_change(host, 0, false);
}
+ dev_err(mmc_dev(host), "****** %s Done\n", __func__);
return 0;
}
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index 0aecd5c00b86..d5b259fc94ea 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -392,7 +392,7 @@ int mmc_add_host(struct mmc_host *host)
#endif
mmc_start_host(host);
- mmc_register_pm_notifier(host);
+ //mmc_register_pm_notifier(host);
return 0;
}
@@ -409,7 +409,7 @@ EXPORT_SYMBOL(mmc_add_host);
*/
void mmc_remove_host(struct mmc_host *host)
{
- mmc_unregister_pm_notifier(host);
+ //mmc_unregister_pm_notifier(host);
mmc_stop_host(host);
#ifdef CONFIG_DEBUG_FS