mmc: mmc: Improve reliability of mmc_select_hs400()
authorAdrian Hunter <adrian.hunter@intel.com>
Wed, 28 Oct 2015 12:25:43 +0000 (14:25 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 9 Nov 2015 12:16:32 +0000 (13:16 +0100)
commitd23029332c3d51fb5ac117ba5cde4dc0a3ec3fa6
tree8b4319a8e9ec6464bf844457f5cc3702e92b06da
parent974007aaf240aa195b31c34cfdb013524a2dcfca
mmc: mmc: Improve reliability of mmc_select_hs400()

mmc_select_hs400() calls __mmc_switch() which checks the switch is
successful using CMD13 (SEND_STATUS).  The problem is that it does that
using the timing settings of the previous mode.  That is prone to error,
especially when switching from HS to HS400 because the timing parameters
for HS mode are tighter than the timing parameters for HS400 mode.

In the case when CMD13 polling is used (i.e. not MMC_CAP_WAIT_WHILE_BUSY)
with the switch command, it must be assumed that using different modes on
the card and host must work.

However in the case when CMD13 polling is not used
(i.e. MMC_CAP_WAIT_WHILE_BUSY) mmc_select_hs400() can be made more
reliable by setting the host to the correct timing before sending CMD13.

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