• A
    mmc: mmc: Improve reliability of mmc_select_hs200() · 1815e61b
    Adrian Hunter 提交于
    Currently mmc_select_hs200() uses __mmc_switch() which checks the
    success of the switch to HS200 mode using CMD13 (SEND_STATUS).
    The problem is that it does that using the timing settings of legacy
    mode.  That is prone to error, not least because the timing parameters
    for legacy mode are tighter than the timing parameters for HS200 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_hs200() can be made more
    reliable by setting the host to the correct timing before sending CMD13.
    
    This patch does that.
    
    A complication is that the caller, mmc_select_timing(), will ignore a
    switch error (indicated by -EBADMSG), assume the old mode is valid
    and continue, so the old timing must be restored in that case.
    Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
    Cc: <stable@vger.kernel.org> # 4.2+
    Tested-by: NAlim Akhtar <alim.akhtar@samsung.com>
    Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
    1815e61b
mmc.c 52.1 KB