]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mmc: sdhci: Fix tuning reset after exhausting the maximum number of loops
authorAdrian Hunter <adrian.hunter@intel.com>
Fri, 2 Dec 2016 13:14:21 +0000 (15:14 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 5 Dec 2016 13:16:21 +0000 (14:16 +0100)
If the driver has exhausted the maximum number of tuning loops, then fixed
sampling is used. To do that both SDHCI_CTRL_TUNED_CLK and
SDHCI_CTRL_EXEC_TUNING must be reset to 0, but only SDHCI_CTRL_TUNED_CLK
was being reset. Reset SDHCI_CTRL_EXEC_TUNING to 0 also.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci.c

index 1d72a51287d4b66f9b0f179260912ba9a1294e12..ad2f2c6113e4ea338427c42cfc34df5fa5e4743c 100644 (file)
@@ -2134,6 +2134,7 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
         */
        if (tuning_loop_counter < 0) {
                ctrl &= ~SDHCI_CTRL_TUNED_CLK;
+               ctrl &= ~SDHCI_CTRL_EXEC_TUNING;
                sdhci_writew(host, ctrl, SDHCI_HOST_CONTROL2);
        }
        if (!(ctrl & SDHCI_CTRL_TUNED_CLK)) {