aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/card/queue.c
diff options
context:
space:
mode:
authorSujit Reddy Thumma <sthumma@codeaurora.org>2011-12-08 14:05:50 +0530
committerChris Ball <cjb@laptop.org>2012-01-11 23:58:44 -0500
commita8ad82cc1b22d04916d9cdb1dc75052e80ac803c (patch)
tree57ebc4322ea4c2e269dd6b3ae599bdbca81528fe /drivers/mmc/card/queue.c
parentmmc: core: Fixup delayed work clock gating patch (diff)
downloadlinux-dev-a8ad82cc1b22d04916d9cdb1dc75052e80ac803c.tar.xz
linux-dev-a8ad82cc1b22d04916d9cdb1dc75052e80ac803c.zip
mmc: card: Kill block requests if card is removed
Kill block requests when the host realizes that the card is removed from the slot and is sure that subsequent requests are bound to fail. Do this silently so that the block layer doesn't output unnecessary error messages. Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/card/queue.c')
-rw-r--r--drivers/mmc/card/queue.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
index dcad59cbfef1..2517547b4366 100644
--- a/drivers/mmc/card/queue.c
+++ b/drivers/mmc/card/queue.c
@@ -29,6 +29,8 @@
*/
static int mmc_prep_request(struct request_queue *q, struct request *req)
{
+ struct mmc_queue *mq = q->queuedata;
+
/*
* We only like normal block requests and discards.
*/
@@ -37,6 +39,9 @@ static int mmc_prep_request(struct request_queue *q, struct request *req)
return BLKPREP_KILL;
}
+ if (mq && mmc_card_removed(mq->card))
+ return BLKPREP_KILL;
+
req->cmd_flags |= REQ_DONTPREP;
return BLKPREP_OK;