mmc: mmc: Fix HS setting in mmc_select_hs400()
authorAdrian Hunter <adrian.hunter@intel.com>
Wed, 28 Oct 2015 12:25:41 +0000 (14:25 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 9 Nov 2015 12:16:20 +0000 (13:16 +0100)
commit51b12f7764fa8bb464cbd0f7bbd3a408d21ade16
treee61ea476673ba3cfc3698ae6daacf23cf12f38a7
parent1815e61b1a7efe81017a883e817292daf7d2f922
mmc: mmc: Fix HS setting in mmc_select_hs400()

mmc_select_hs400() begins with the card and host in HS200 mode.
Therefore, any commands sent to the card should use HS200 timing.
It is incorrect to set the host to High Speed (HS) timing before
sending the switch command.  Doing so is unreliable because
the timing parameters for HS mode are tighter than the timing
parameters for HS200 mode.  Thus the HS timings should be set
only after the card has switched mode.

However, it is not unreasonable first to reduce the frequency to
the HS mode frequency, which should make the switch command and
subsequent CMD13 commands more reliable.

This patch does that.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: <stable@vger.kernel.org> # 4.2+
Tested-by: Alim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/core/mmc.c