mmc: block: don't start new request when the card is removed
authorSeungwon Jeon <[email protected]>
Tue, 22 Jan 2013 10:48:07 +0000 (19:48 +0900)
committerChris Ball <[email protected]>
Sun, 24 Feb 2013 19:37:12 +0000 (14:37 -0500)
It's not necessary to start a new request while error handling if
the card was removed.

Signed-off-by: Seungwon Jeon <[email protected]>
Acked-by: Jaehoon Chung <[email protected]>
Tested-by: Konstantin Dorfman <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
drivers/mmc/card/block.c

index f79b4688e4718f83f792d31a3221f40fd6450edb..1170afe1a59602f053a772e8bad9db4c8571272b 100644 (file)
@@ -1456,8 +1456,14 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *rqc)
 
  start_new_req:
        if (rqc) {
-               mmc_blk_rw_rq_prep(mq->mqrq_cur, card, 0, mq);
-               mmc_start_req(card->host, &mq->mqrq_cur->mmc_active, NULL);
+               if (mmc_card_removed(card)) {
+                       rqc->cmd_flags |= REQ_QUIET;
+                       blk_end_request_all(rqc, -EIO);
+               } else {
+                       mmc_blk_rw_rq_prep(mq->mqrq_cur, card, 0, mq);
+                       mmc_start_req(card->host,
+                                     &mq->mqrq_cur->mmc_active, NULL);
+               }
        }
 
        return 0;