mmc: add rto for infinit sending timeout loop
authorlintao <lintao@rock-chips.com>
Thu, 20 Nov 2014 01:47:32 +0000 (09:47 +0800)
committerlintao <lintao@rock-chips.com>
Thu, 27 Nov 2014 07:25:47 +0000 (15:25 +0800)
commit426495888a245034d2b60e8c032ed5bd725a44ac
tree62270e6a69cff13dbe399c28724fea5e5a0d5d74
parent630463c3338f14c4254602aae1d4facb6611e18f
mmc: add rto for infinit sending timeout loop

dw_mci write cmd index to CMD register to trigger sending cmd by BIU.
However, if device fall into panic holding cmd/data line to low level cause BIU
cannnot send out cmd forever. So no cmd_done_int will come. AND, cmd response timeout
only valid after cmd been sent. Nothing to break this loop, we need a s/w recovery from
STATE_SENDING_CMD to STATE_IDLE, and the pending one reported as -ETIMEOUT, let caller
decide howto again.

Reported-by: roger.hu <hwg@rock-chips.com>
Signed-off-by: lintao <lintao@rock-chips.com>
Reviewed-and-tested-by: roger.hu <hwg@rock-chips.com>
drivers/mmc/host/rk_sdmmc.c
include/linux/mmc/rk_mmc.h