]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
mmc: sdhci: set_ios: delayed clock gate flush
authorBitan Biswas <bbiswas@nvidia.com>
Fri, 9 May 2014 07:11:47 +0000 (12:41 +0530)
committerBitan Biswas <bbiswas@nvidia.com>
Mon, 12 May 2014 09:46:38 +0000 (02:46 -0700)
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-on: http://git-master/r/407613/
Reviewed-on: http://git-master/r/407614
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Venu Byravarasu <vbyravarasu@nvidia.com>
drivers/mmc/host/sdhci.c

index 488fc3fca24e777f1ab8cd408caaca419afecd7e..99eb12e234e36d347c4238db88de033cee606dd3 100644 (file)
@@ -1752,6 +1752,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);
@@ -2461,9 +2464,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);
 
@@ -3125,7 +3127,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))) {