]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mmc: sdhci: Fix recovery from tuning timeout
authorAdrian Hunter <adrian.hunter@intel.com>
Fri, 2 Dec 2016 13:14:20 +0000 (15:14 +0200)
committerSasha Levin <alexander.levin@verizon.com>
Fri, 13 Jan 2017 01:56:55 +0000 (20:56 -0500)
commita2080cc28041dedeec50b5610beaa00850c62d73
tree6448f1619dd13a8586551c1edab8f3f03aae2524
parent2a1dc36fdc71dabcf55ee316e09f5cc01b6a5a18
mmc: sdhci: Fix recovery from tuning timeout

[ Upstream commit 61e53bd0047d58caee0c7170613045bf96de4458 ]

Clearing the tuning bits should reset the tuning circuit. However there is
more to do. Reset the command and data lines for good measure, and then
for eMMC ensure the card is not still trying to process a tuning command by
sending a stop command.

Note the JEDEC eMMC specification says the stop command (CMD12) can be used
to stop a tuning command (CMD21) whereas the SD specification is silent on
the subject with respect to the SD tuning command (CMD19). Considering that
CMD12 is not a valid SDIO command, the stop command is sent only when the
tuning command is CMD21 i.e. for eMMC. That addresses cases seen so far
which have been on eMMC.

Note that this replaces the commit fe5fb2e3b58f ("mmc: sdhci: Reset cmd and
data circuits after tuning failure") which is being reverted for v4.9+.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Tested-by: Dan O'Donovan <dan@emutex.com>
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
drivers/mmc/host/sdhci.c