]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.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)
committerPavan Kunapuli <pkunapuli@nvidia.com>
Wed, 6 May 2015 14:49:00 +0000 (07:49 -0700)
-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

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
(cherry picked from commit e5b985f1befcb0d850cbb4138317c07f66cb71e4)
Change-Id: Ieabdc0ad05d5608e89803edb115dad1516a20f10
Signed-off-by: Pavan Kunapuli <pkunapuli@nvidia.com>
Reviewed-on: http://git-master/r/739668
Reviewed-by: Automatic_Commit_Validation_User
drivers/mmc/host/sdhci-tegra.c

index b9c72dc710d6ea69d112cd03cd63772371d1b139..b31b33484bae0a5a1a3d25140a201680d0b0dfd8 100644 (file)
@@ -1448,16 +1448,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 removable card is not present */
-       if (!(sdhci->mmc->caps & MMC_CAP_NONREMOVABLE) &&
-               (mmc_gpio_get_cd(sdhci->mmc) != 0) && 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 removable card is not present */
+       if (!(sdhci->mmc->caps & MMC_CAP_NONREMOVABLE) &&
+               (mmc_gpio_get_cd(sdhci->mmc) != 0) && tegra_host->clk_enabled)
+               tegra_sdhci_set_clock(sdhci, 0);
 }
 
 static const struct sdhci_ops tegra_sdhci_ops = {