summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAsutosh Das <asutoshd@codeaurora.org>2013-03-26 17:21:32 +0530
committerSubhash Jadavani <subhashj@codeaurora.org>2016-05-31 15:20:48 -0700
commita4ec42db59ec72285b0b0823c6f96ca2400f9fdd (patch)
treea46d203a2c06d9e6ad92dbd2f17c0fd10a145ba1 /drivers
parent20537f4aae5abd63918edc990a5ea9d355b6ad58 (diff)
mmc: sd: Set the card removed if card detect fails
Currently, the card state is not being set as removed, even when the card is actually removed. We still wait for the next request to fail and then check the error and set the card to be removed. With the new runtime-pm in place, the card device would be removed on physical removal of card and the corresponding parent would be suspended as well. Hence, when the queue is flushed during clean-up, mmc_rpm_hold would be invoked, which would fail, since the runtime-pm was disabled when the card device was removed. Thus, it won't resume the card/host/ platform device. The request would continue and since the controller is in suspended state nasty things would happen. This patch sets the card as removed during mmc_sd_detect itself, so that when a clean-up of queue happens during card removal, it is known that the card has been removed and the request is errored out there itself. Change-Id: Id5022f8d7db43750edf137d4293796615b56ae36 Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/core/sd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index f9b5b4ad4985..2ec08b6154d6 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -1149,6 +1149,7 @@ static void mmc_sd_detect(struct mmc_host *host)
if (!retries) {
printk(KERN_ERR "%s(%s): Unable to re-detect card (%d)\n",
__func__, mmc_hostname(host), err);
+ err = _mmc_detect_card_removed(host);
}
#else
err = _mmc_detect_card_removed(host);