aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.14.71/5759-mmc-sdhci-add-tuning-error-codes.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.14.71/5759-mmc-sdhci-add-tuning-error-codes.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.14.71/5759-mmc-sdhci-add-tuning-error-codes.patch78
1 files changed, 78 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.14.71/5759-mmc-sdhci-add-tuning-error-codes.patch b/common/recipes-kernel/linux/linux-yocto-4.14.71/5759-mmc-sdhci-add-tuning-error-codes.patch
new file mode 100644
index 00000000..898d0c2d
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.14.71/5759-mmc-sdhci-add-tuning-error-codes.patch
@@ -0,0 +1,78 @@
+From a506f9c83131d69c3a1ccfb3684f128ddb379111 Mon Sep 17 00:00:00 2001
+From: Yinbo Zhu <yinbo.zhu@nxp.com>
+Date: Thu, 23 Aug 2018 16:48:31 +0800
+Subject: [PATCH 5759/5765] mmc: sdhci: add tuning error codes
+
+This patch is to add tuning error codes to
+judge tuning state
+
+Signed-off-by: Yinbo Zhu <yinbo.zhu@nxp.com>
+Acked-by: Adrian Hunter <adrian.hunter@intel.com>
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Sudheesh Mavila <sudheesh.mavila@amd.com>
+---
+ drivers/mmc/host/sdhci.c | 9 +++++----
+ drivers/mmc/host/sdhci.h | 1 +
+ 2 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
+index 7e29a39d5873..21dff5c7d96d 100644
+--- a/drivers/mmc/host/sdhci.c
++++ b/drivers/mmc/host/sdhci.c
+@@ -2261,7 +2261,7 @@ void sdhci_send_tuning(struct sdhci_host *host, u32 opcode)
+ }
+ EXPORT_SYMBOL_GPL(sdhci_send_tuning);
+
+-static void __sdhci_execute_tuning(struct sdhci_host *host, u32 opcode)
++static int __sdhci_execute_tuning(struct sdhci_host *host, u32 opcode)
+ {
+ int i;
+
+@@ -2278,13 +2278,13 @@ static void __sdhci_execute_tuning(struct sdhci_host *host, u32 opcode)
+ pr_info("%s: Tuning timeout, falling back to fixed sampling clock\n",
+ mmc_hostname(host->mmc));
+ sdhci_abort_tuning(host, opcode);
+- return;
++ return -ETIMEDOUT;
+ }
+
+ ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2);
+ if (!(ctrl & SDHCI_CTRL_EXEC_TUNING)) {
+ if (ctrl & SDHCI_CTRL_TUNED_CLK)
+- return; /* Success! */
++ return 0; /* Success! */
+ break;
+ }
+
+@@ -2296,6 +2296,7 @@ static void __sdhci_execute_tuning(struct sdhci_host *host, u32 opcode)
+ pr_info("%s: Tuning failed, falling back to fixed sampling clock\n",
+ mmc_hostname(host->mmc));
+ sdhci_reset_tuning(host);
++ return -EAGAIN;
+ }
+
+ int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
+@@ -2357,7 +2358,7 @@ int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
+
+ sdhci_start_tuning(host);
+
+- __sdhci_execute_tuning(host, opcode);
++ host->tuning_err = __sdhci_execute_tuning(host, opcode);
+
+ sdhci_end_tuning(host);
+ out:
+diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
+index dd3219ebbf22..0a96a0ef017a 100755
+--- a/drivers/mmc/host/sdhci.h
++++ b/drivers/mmc/host/sdhci.h
+@@ -564,6 +564,7 @@ struct sdhci_host {
+
+ unsigned int tuning_count; /* Timer count for re-tuning */
+ unsigned int tuning_mode; /* Re-tuning mode supported by host */
++ unsigned int tuning_err; /* Error code for re-tuning */
+ #define SDHCI_TUNING_MODE_1 0
+ #define SDHCI_TUNING_MODE_2 1
+ #define SDHCI_TUNING_MODE_3 2
+--
+2.17.1
+