UPSTREAM: mmc: core: fix __mmc_switch timeout caused by preempt
authorChaotian Jing <chaotian.jing@mediatek.com>
Mon, 30 Nov 2015 01:27:30 +0000 (09:27 +0800)
committerGerrit Code Review <gerrit@rock-chips.com>
Fri, 25 Mar 2016 06:58:22 +0000 (14:58 +0800)
commit2f98f55d98d5375327224db9bfb56b2be19e881d
treedbce1fe814ca194fdc485a15972aa71c3d1a6be8
parent354189f07494b7ed425f593cb1736b91bc8aa8d0
UPSTREAM: mmc: core: fix __mmc_switch timeout caused by preempt

there is a time window between __mmc_send_status() and time_afer(),
on some eMMC chip, the timeout_ms is only 10ms, if this thread was
scheduled out during this period, then, even card has already changes
to transfer state by the result of CMD13, this part of code also treat
it to timeout error.
So, need calculate timeout first, then call __mmc_send_status(), if
already timeout and card still in programing state, then treat it to
the real timeout error.

Change-Id: I7499d3d41711ea5abe6baec780d2988dc60dfc5b
Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit 3bbb0deea6d5c6d5ed38ae927a5bf9b0cd7c8639)
drivers/mmc/core/mmc_ops.c