Skip to contentSkip to conversation

mmc: sdhci-msm: Clear tuning done flag while hs400 tuning

PATCH In review Veerabhadrarao Badiganti 2 participants 3 messages May 28, 2020 – May 29, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: sdhci-msm: Clear tuning done flag while hs400 tuning

Clear tuning_done flag while executing tuning to ensure vendor specific HS400 settings are applied properly when the controller is re-initialized in HS400 mode.

Without this, re-initialization of the qcom SDHC in HS400 mode fails while resuming the driver from runtime-suspend or system-suspend.

Fixes ff06ce4 ("mmc: sdhci-msm: Add HS400 platform support")
---
 drivers/mmc/host/sdhci-msm.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/mmc/host/sdhci-msm.c +6 -0
index 95cd973..b277dd7 100644
@@ -1174,6 +1174,12 @@ static int sdhci_msm_execute_tuning(struct mmc_host *mmc, u32 opcode)
 	msm_host->use_cdr = true;
 
 	/*
+	 * Clear tuning_done flag before tuning to ensure proper
+	 * HS400 settings.
+	 */
+	msm_host->tuning_done = 0;
+
+	/*
 	 * For HS400 tuning in HS200 timing requires:
 	 * - select MCLK/2 in VENDOR_SPEC
 	 * - program MCLK to 400MHz (or nearest supported) in GCC
Signature · 1 line
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
#1 lore raw
Quoted 11 lines · Veerabhadrarao Badiganti

Clear tuning_done flag while executing tuning to ensure vendor specific HS400 settings are applied properly when the controller is re-initialized in HS400 mode.

Without this, re-initialization of the qcom SDHC in HS400 mode fails while resuming the driver from runtime-suspend or system-suspend.

Fixes ff06ce4 ("mmc: sdhci-msm: Add HS400 platform support")

Applied for next, thanks!

Kind regards
Uffe

Quoted 24 lines
---
 drivers/mmc/host/sdhci-msm.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/mmc/host/sdhci-msm.c +6 -1
index 95cd973..b277dd7 100644
@@ -1174,6 +1174,12 @@ static int sdhci_msm_execute_tuning(struct mmc_host *mmc, u32 opcode)
        msm_host->use_cdr = true;
 
        /*
+        * Clear tuning_done flag before tuning to ensure proper
+        * HS400 settings.
+        */
+       msm_host->tuning_done = 0;
+
+       /*
         * For HS400 tuning in HS200 timing requires:
         * - select MCLK/2 in VENDOR_SPEC
         * - program MCLK to 400MHz (or nearest supported) in GCC
--

Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

#2 lore raw
Quoted 9 lines · Ulf Hansson
Quoted 7 lines · Veerabhadrarao Badiganti

Clear tuning_done flag while executing tuning to ensure vendor specific HS400 settings are applied properly when the controller is re-initialized in HS400 mode.

Without this, re-initialization of the qcom SDHC in HS400 mode fails while resuming the driver from runtime-suspend or system-suspend.

Quoted 7 lines
Quoted 3 lines
Fixes ff06ce4 ("mmc: sdhci-msm: Add HS400 platform support")

Applied for next, thanks!

Kind regards
Uffe

Thanks Ulf.
I see a mail on this patch, that SHA in the commit text should be 12 digit. Let me know if i have to re-post this patch by correcting it.

Quoted 24 lines
Quoted 24 lines
---
  drivers/mmc/host/sdhci-msm.c | 6 ++++++
  1 file changed, 6 insertions(+)
drivers/mmc/host/sdhci-msm.c +6 -1
index 95cd973..b277dd7 100644
@@ -1174,6 +1174,12 @@ static int sdhci_msm_execute_tuning(struct mmc_host *mmc, u32 opcode)
         msm_host->use_cdr = true;
 
         /*
+        * Clear tuning_done flag before tuning to ensure proper
+        * HS400 settings.
+        */
+       msm_host->tuning_done = 0;
+
+       /*
          * For HS400 tuning in HS200 timing requires:
          * - select MCLK/2 in VENDOR_SPEC
          * - program MCLK to 400MHz (or nearest supported) in GCC
--

Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project