OSDN Git Service

mmc: sdhci-msm: Fix recursive tuning issue
authorSahitya Tummala <stummala@codeaurora.org>
Tue, 17 Nov 2015 03:54:53 +0000 (09:24 +0530)
committerSubhash Jadavani <subhashj@codeaurora.org>
Tue, 31 May 2016 22:28:10 +0000 (15:28 -0700)
For any commands, that are sent during tuning sequence
CRC errors are expected. But if SDHCI_NEEDS_RETUNING flag
is set, then it will recursively do the tuning and gets
stuck in tuning. Fix this by not allowing the re-tuning to
happen while it is already in tuning process.

Change-Id: I9cc39f03a01c34f2f5639d4c20776fd575c25231
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
drivers/mmc/host/sdhci-msm.c
drivers/mmc/host/sdhci-msm.h

index 7f4d222..39de389 100644 (file)
@@ -966,6 +966,13 @@ int sdhci_msm_execute_tuning(struct sdhci_host *host, u32 opcode)
                (ios.timing == MMC_TIMING_UHS_SDR104)))
                return 0;
 
+       /*
+        * Don't allow re-tuning for CRC errors observed for any commands
+        * that are sent during tuning sequence itself.
+        */
+       if (msm_host->tuning_in_progress)
+               return 0;
+       msm_host->tuning_in_progress = true;
        pr_debug("%s: Enter %s\n", mmc_hostname(mmc), __func__);
 
        /* CDC/SDC4 DLL HW calibration is only required for HS400 mode*/
@@ -1142,6 +1149,7 @@ out:
        if (!rc)
                msm_host->tuning_done = true;
        spin_unlock_irqrestore(&host->lock, flags);
+       msm_host->tuning_in_progress = false;
        pr_debug("%s: Exit %s, err(%d)\n", mmc_hostname(mmc), __func__, rc);
        return rc;
 }
index 0078576..e47a508 100644 (file)
@@ -213,6 +213,7 @@ struct sdhci_msm_host {
        struct device_attribute pm_qos_group_status_attr;
        bool pm_qos_group_enable;
        struct sdhci_msm_pm_qos_irq pm_qos_irq;
+       bool tuning_in_progress;
 };
 
 extern char *saved_command_line;