diff options
author | Sujit Reddy Thumma <sthumma@codeaurora.org> | 2011-12-08 14:05:50 +0530 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2012-01-11 23:58:44 -0500 |
commit | a8ad82cc1b22d04916d9cdb1dc75052e80ac803c (patch) | |
tree | 57ebc4322ea4c2e269dd6b3ae599bdbca81528fe /drivers/mmc/card/queue.c | |
parent | 4137e50494cb3496fbb6ccd27aa7b6d7c9634c1e (diff) |
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.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c index dcad59cbfef..2517547b436 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; |