]> git.baikalelectronics.ru Git - kernel.git/commit
mmc: sdhci-of-esdhc: set timeout to max before tuning
authorMichael Walle <michael@walle.cc>
Thu, 22 Oct 2020 22:23:37 +0000 (00:23 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Fri, 23 Oct 2020 12:16:47 +0000 (14:16 +0200)
commit3abc707dd4df7eefda0f2d7253d42ab585b6484c
tree8957740063bdf54296dfc5fa30f52039d9e59fb2
parent962ab9a4517a9182247a831516776c03b9040cb1
mmc: sdhci-of-esdhc: set timeout to max before tuning

On rare occations there is the following error:

  mmc0: Tuning timeout, falling back to fixed sampling clock

There are SD cards which takes a significant longer time to reply to the
first CMD19 command. The eSDHC takes the data timeout value into account
during the tuning period. The SDHCI core doesn't explicitly set this
timeout for the tuning procedure. Thus on the slow cards, there might be
a spurious "Buffer Read Ready" interrupt, which in turn triggers a wrong
sequence of events. In the end this will lead to an unsuccessful tuning
procedure and to the above error.

To workaround this, set the timeout to the maximum value (which is the
best we can do) and the SDHCI core will take care of the proper timeout
handling.

Fixes: 2a92cebfe9f3 ("mmc: sdhci-of-esdhc: add tuning support")
Signed-off-by: Michael Walle <michael@walle.cc>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20201022222337.19857-1-michael@walle.cc
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci-of-esdhc.c