From 7a81902fa52f2b6f5037e167f74ebb5a41cfc7d1 Mon Sep 17 00:00:00 2001 From: Seungwon Jeon Date: Tue, 22 Jan 2013 19:48:07 +0900 Subject: [PATCH] mmc: block: don't start new request when the card is removed It's not necessary to start a new request while error handling if the card was removed. Signed-off-by: Seungwon Jeon Acked-by: Jaehoon Chung Tested-by: Konstantin Dorfman Signed-off-by: Chris Ball --- drivers/mmc/card/block.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index f79b4688e471..1170afe1a596 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -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; -- 2.30.2