summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSahitya Tummala <stummala@codeaurora.org>2015-11-17 09:24:53 +0530
committerSubhash Jadavani <subhashj@codeaurora.org>2016-05-31 15:28:10 -0700
commitbb0fb32d8a10e6a38f5d615a8c604f9c2bf6d290 (patch)
tree478c424bc2fc908abc8a12ab8b052317620b602d
parent861ecf399bd1c94c0b640e1b8da7691b1d0b08f3 (diff)
mmc: sdhci-msm: Fix recursive tuning issue
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>
-rw-r--r--drivers/mmc/host/sdhci-msm.c8
-rw-r--r--drivers/mmc/host/sdhci-msm.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index 7f4d22276194..39de38908718 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -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;
}
diff --git a/drivers/mmc/host/sdhci-msm.h b/drivers/mmc/host/sdhci-msm.h
index 00785765a1ec..e47a5083e8a6 100644
--- a/drivers/mmc/host/sdhci-msm.h
+++ b/drivers/mmc/host/sdhci-msm.h
@@ -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;