summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@quicinc.com>2017-10-05 16:09:47 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-10-05 16:09:46 -0700
commit928b34b6b318c80f24802f50bc04cf9678530b45 (patch)
tree80e71861dd974c6742e2642629a40cb5ac6d79e9 /drivers
parent6963c78e4d5326eb38211448a136ed1ec7f62ce7 (diff)
parentf411e6c386362715492b0e6255ba0a4c905f5b6c (diff)
Merge "mmc: sdhci-msm: flush mmc detect work asynchronously."
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/core/core.c12
-rw-r--r--drivers/mmc/host/sdhci-msm.c3
2 files changed, 15 insertions, 0 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 0da9c5caea13..0a26a07e7aee 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -4165,6 +4165,18 @@ int mmc_detect_card_removed(struct mmc_host *host)
}
EXPORT_SYMBOL(mmc_detect_card_removed);
+/*
+ * This should be called to make sure that detect work(mmc_rescan)
+ * is completed.Drivers may use this function from async schedule/probe
+ * contexts to make sure that the bootdevice detection is completed on
+ * completion of async_schedule.
+ */
+void mmc_flush_detect_work(struct mmc_host *host)
+{
+ flush_delayed_work(&host->detect);
+}
+EXPORT_SYMBOL(mmc_flush_detect_work);
+
void mmc_rescan(struct work_struct *work)
{
unsigned long flags;
diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index df3fce93b6d1..45d2f69f5f1a 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -4747,6 +4747,9 @@ static int sdhci_msm_probe(struct platform_device *pdev)
mmc_hostname(host->mmc), __func__, ret);
device_remove_file(&pdev->dev, &msm_host->auto_cmd21_attr);
}
+ if (sdhci_msm_is_bootdevice(&pdev->dev))
+ mmc_flush_detect_work(host->mmc);
+
/* Successful initialization */
goto out;