]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
mmc: tegra: Fix dll calibration execution sequence
authorNaveen Kumar Arepalli <naveenk@nvidia.com>
Fri, 12 Dec 2014 09:11:32 +0000 (14:41 +0530)
committerNaveen Kumar Arepalli <naveenk@nvidia.com>
Tue, 23 Dec 2014 12:29:58 +0000 (04:29 -0800)
-In post resume function clocks are turned off if
card is not present or the device is dead. And then
we are executing dll caliration. Move calling dll calibration
code before turning off clocks to avoid corner case errors.

Bug 200059630

Change-Id: Ieabdc0ad05d5608e89803edb115dad1516a20f10
Signed-off-by: Naveen Kumar Arepalli <naveenk@nvidia.com>
Reviewed-on: http://git-master/r/664557
(cherry picked from commit 20a07798d5f165c5f6210545fb167905085fb9eb)
Reviewed-on: http://git-master/r/663119
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Venu Byravarasu <vbyravarasu@nvidia.com>
drivers/mmc/host/sdhci-tegra.c

index 7dce8e7faba62abebf3e9331fb8e1ea105e964b5..0b31e60f1e13e55ab2ddf74a00864df00a40ba48 100644 (file)
@@ -3916,16 +3916,16 @@ static void tegra_sdhci_post_resume(struct sdhci_host *sdhci)
        struct sdhci_tegra *tegra_host = pltfm_host->priv;
        bool dll_calib_req = false;
 
-       /* Turn OFF the clocks if the device is not present */
-       if ((!tegra_host->card_present || !sdhci->mmc->card) &&
-               tegra_host->clk_enabled)
-               tegra_sdhci_set_clock(sdhci, 0);
-
        dll_calib_req = (sdhci->mmc->card &&
                (sdhci->mmc->card->type == MMC_TYPE_MMC) &&
                (sdhci->mmc->ios.timing == MMC_TIMING_MMC_HS400));
        if (dll_calib_req)
                tegra_sdhci_do_dll_calibration(sdhci);
+
+       /* Turn OFF the clocks if the device is not present */
+       if ((!tegra_host->card_present || !sdhci->mmc->card) &&
+               tegra_host->clk_enabled)
+               tegra_sdhci_set_clock(sdhci, 0);
 }
 
 /*