summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorBitan Biswas <bbiswas@nvidia.com>2014-05-09 12:41:47 +0530
committerRiham Haidar <rhaidar@nvidia.com>2014-05-12 16:35:21 -0700
commitd19acf44b561b166c9ac2cfd7f84fe145004d917 (patch)
tree42e775bd6b3ffc90d176e10558f111b086a28ff4 /drivers/mmc
parent55c61b1caf7264af93df00617b5a81f40e38b8e7 (diff)
mmc: sdhci: set_ios: delayed clock gate flush
Before sdhci set_ios call we need to flush outstanding delayed clock gate work. Else, it could cause unintended clock gate resulting in hard hang. - unconditionally cancel delayed clock gate work since sometimes mmc->card->type is uninitialized. bug 200000303 Change-Id: I208a8a15dfd4f8d8ae1614d0fadee6deb5a55bb0 Signed-off-by: Bitan Biswas <bbiswas@nvidia.com> Reviewed-on: http://git-master/r/407407 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Naveen Kumar Arepalli <naveenk@nvidia.com> Reviewed-by: Pavan Kunapuli <pkunapuli@nvidia.com> Reviewed-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sdhci.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 2bf4f3d83df6..9168f676ec2c 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1760,6 +1760,9 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios)
int vdd_bit = -1;
u8 ctrl;
+ /* cancel delayed clk gate work */
+ cancel_delayed_work_sync(&host->delayed_clk_gate_wrk);
+
/* Do any required preparations prior to setting ios */
if (host->ops->platform_ios_config_enter)
host->ops->platform_ios_config_enter(host, ios);
@@ -2469,9 +2472,8 @@ int sdhci_enable(struct mmc_host *mmc)
if (!mmc->card || !(mmc->caps2 & MMC_CAP2_CLOCK_GATING))
return 0;
- if (IS_DELAYED_CLK_GATE(host))
- /* cancel sdio clk gate work */
- cancel_delayed_work_sync(&host->delayed_clk_gate_wrk);
+ /* cancel delayed clk gate work */
+ cancel_delayed_work_sync(&host->delayed_clk_gate_wrk);
sysedp_set_state(host->sysedpc, 1);
@@ -3130,7 +3132,7 @@ int sdhci_suspend_host(struct sdhci_host *host)
host->card_int_set = sdhci_readl(host, SDHCI_INT_ENABLE) &
SDHCI_INT_CARD_INT;
- /* cancel sdio clk gate work */
+ /* cancel delayed clk gate work */
cancel_delayed_work_sync(&host->delayed_clk_gate_wrk);
if (!device_may_wakeup(mmc_dev(host->mmc))) {