aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Wood <brian.j.wood@intel.com>2015-10-27 15:13:05 -0700
committerLee Campbell <leecam@google.com>2015-10-27 21:10:59 -0700
commit57faed486dddeb7278d58d31a3883999de72d1f1 (patch)
tree166269f04140b941f2d660e28918ff58a63c1d13
parent35ce35dff47d10318ca7a9cbeabf416c83d9f58a (diff)
downloadedison-v3.10-57faed486dddeb7278d58d31a3883999de72d1f1.tar.gz
MMC hang during reboot from dequeue of mmc devicebrillo-m7-releasebrillo-m7-dev
This commit resolves the issue where the Intel Edison will hang if rebooted more than once (repeated reboots). It was found that the mmc device was being registerd twice with 2 shutdown functions. When a device reboot/shutdown operation was called the same mmc device was trying to be cancelled from a workqueue. This situation caused a race condition on the second operation since the cancelled work will wait for completion. Also added in code needed for proper resume setting for MMC power state. Change-Id: I1400df84e178d2b582725db2129ea7ee7c28a4da Signed-off-by: Brian Wood <brian.j.wood@intel.com>
-rw-r--r--drivers/mmc/card/block.c14
-rw-r--r--drivers/mmc/core/mmc.c10
-rw-r--r--drivers/staging/edison-bcm43340/bcmsdh_sdmmc_linux.c2
3 files changed, 2 insertions, 24 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 7fedaa6b4dc..3ade58e56f5 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -2576,24 +2576,10 @@ static int _mmc_blk_suspend(struct mmc_card *card)
{
struct mmc_blk_data *part_md;
struct mmc_blk_data *md = mmc_get_drvdata(card);
-
if (md) {
mmc_queue_suspend(&md->queue);
list_for_each_entry(part_md, &md->part, part) {
mmc_queue_suspend(&part_md->queue);
- if (part_md->part_type ==
- EXT_CSD_PART_CONFIG_ACC_RPMB) {
- /*
- * RPMB partition is accessed by API directly.
- * Driver need to set a flag when suspending
- * MMC block device to notify API that the
- * accessing of RPMB partition needs to be
- * stopped
- */
- mmc_claim_host(card->host);
- part_md->flags |= MMC_BLK_SUSPENDED;
- mmc_release_host(card->host);
- }
}
}
return 0;
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 98a7e4859e0..4744f7c13c1 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1582,14 +1582,6 @@ static int mmc_suspend(struct mmc_host *host)
}
/*
- * Shutdown callback
- */
-static int mmc_shutdown(struct mmc_host *host)
-{
- return _mmc_suspend(host, false);
-}
-
-/*
* Resume callback from host.
*
* This function tries to determine if the same card is still present
@@ -1660,7 +1652,6 @@ static const struct mmc_bus_ops mmc_ops = {
.resume = NULL,
.power_restore = mmc_power_restore,
.alive = mmc_alive,
- .shutdown = mmc_shutdown,
};
static const struct mmc_bus_ops mmc_ops_unsafe = {
@@ -1672,7 +1663,6 @@ static const struct mmc_bus_ops mmc_ops_unsafe = {
.resume = mmc_resume,
.power_restore = mmc_power_restore,
.alive = mmc_alive,
- .shutdown = mmc_shutdown,
};
static void mmc_attach_bus_ops(struct mmc_host *host)
diff --git a/drivers/staging/edison-bcm43340/bcmsdh_sdmmc_linux.c b/drivers/staging/edison-bcm43340/bcmsdh_sdmmc_linux.c
index 1d5e5792906..746a1a342b5 100644
--- a/drivers/staging/edison-bcm43340/bcmsdh_sdmmc_linux.c
+++ b/drivers/staging/edison-bcm43340/bcmsdh_sdmmc_linux.c
@@ -362,6 +362,8 @@ static int bcmsdh_sdmmc_resume(struct device *pdev)
#if defined(OOB_INTR_ONLY)
bcmsdh_resume(sdioh->bcmsdh);
#endif
+ if (func->card && func->card->host)
+ func->card->host->pm_flags &= ~MMC_PM_KEEP_POWER;
smp_mb();
return 0;