mmc: dw_mmc: check card present before starting request
authorShawn Lin <shawn.lin@rock-chips.com>
Fri, 27 May 2016 07:42:35 +0000 (15:42 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Mon, 30 May 2016 09:35:10 +0000 (17:35 +0800)
commite1e805c61fb37ad3a79a06fe5e248908818f2785
tree9a9fbcc3ad5a7cb756c34430bd988962c91072cb
parentda072376421ae6a1773a9977fd831d611171aa31
mmc: dw_mmc: check card present before starting request

The main reason to add this check is to avoid unnecessary
mmc_request like the on-going cmd and the corresponding sbc
if the card is removed. Although we have already checked this in
dw_mci_handle_cd for runtime usage of sd card and dw_mci_init_slot
for noremovable devices, but there is a timing gap before it really
calls dw_mci_get_cd as mmc_detect_change needs some delay here.

Another gain here is that we could save some checkings of card status
after sd card been removed.

Change-Id: Iea741c1c72985fbe078f48da3796bddcab816e66
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
drivers/mmc/host/dw_mmc.c