From 8a25687e110bbf842ffe85bc1f76d4f2101c1a61 Mon Sep 17 00:00:00 2001 From: Aaron Lu Date: Fri, 29 Jun 2012 16:17:31 +0800 Subject: [PATCH] --- yaml --- r: 312845 b: refs/heads/master c: b67c6b411dcf17199e1dfdf18da8b1c6caf73e6e h: refs/heads/master i: 312843: aa2ed208e258226c1e2d2eb4473049e5fe612f4f v: v3 --- [refs] | 2 +- trunk/drivers/mmc/host/sdhci.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 56d9ed005e3b..3c75141b8098 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 473b095a72a95ba719905b1f2e82cd18d099a427 +refs/heads/master: b67c6b411dcf17199e1dfdf18da8b1c6caf73e6e diff --git a/trunk/drivers/mmc/host/sdhci.c b/trunk/drivers/mmc/host/sdhci.c index 12015151fab9..b0a5629dea3e 100644 --- a/trunk/drivers/mmc/host/sdhci.c +++ b/trunk/drivers/mmc/host/sdhci.c @@ -245,6 +245,18 @@ static void sdhci_init(struct sdhci_host *host, int soft) static void sdhci_reinit(struct sdhci_host *host) { sdhci_init(host, 0); + /* + * Retuning stuffs are affected by different cards inserted and only + * applicable to UHS-I cards. So reset these fields to their initial + * value when card is removed. + */ + if (host->version >= SDHCI_SPEC_300 && host->tuning_count && + host->tuning_mode == SDHCI_TUNING_MODE_1) { + del_timer_sync(&host->tuning_timer); + host->flags &= ~SDHCI_NEEDS_RETUNING; + host->mmc->max_blk_count = + (host->quirks & SDHCI_QUIRK_NO_MULTIBLOCK) ? 1 : 65535; + } sdhci_enable_card_detection(host); }