]> git.baikalelectronics.ru Git - kernel.git/commit
mmc: core: Allow CMD13 polling when switching to HS mode for mmc
authorUlf Hansson <ulf.hansson@linaro.org>
Wed, 9 Nov 2016 18:40:29 +0000 (19:40 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 29 Nov 2016 08:05:25 +0000 (09:05 +0100)
commit359d3ca7256855e6bb16bad418c1ba651fd03420
treef18d32f1c55720c657f9dbda88d15161d7c5653e
parent4d20e81228f6a774b1b21efacced941c86b320c2
mmc: core: Allow CMD13 polling when switching to HS mode for mmc

In cases when the mmc host doesn't support HW busy detection, polling for a
card being busy by using CMD13 is beneficial. That is because, instead of
waiting a fixed amount of time, 500ms or the generic CMD6 time from
EXT_CSD, we find out a lot sooner when the card stops signaling busy. This
leads to a significant decreased total initialization time for the mmc
card.

However, to allow polling with CMD13 during a bus timing change operation,
such as switching to HS mode, we first need to update the mmc host's bus
timing before starting to poll. Deal with that, simply by providing
MMC_TIMING_MMC_HS as the timing parameter to __mmc_switch() from
mmc_select_hs().

By telling __mmc_switch() to allow polling with CMD13, also makes it
validate the CMD6 status, thus we can remove the corresponding checks.

When switching to HS400ES, the mmc_select_hs() function is called in one of
the intermediate steps. To still prevent CMD13 polling for HS400ES, let's
call the __mmc_switch() function in this path as it enables us to keep
using the existing method.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
drivers/mmc/core/mmc.c