From patchwork Tue Jan 22 10:48:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seungwon Jeon X-Patchwork-Id: 2017671 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id AC5943FD1A for ; Tue, 22 Jan 2013 10:48:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751899Ab3AVKsY (ORCPT ); Tue, 22 Jan 2013 05:48:24 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:10276 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751449Ab3AVKsX (ORCPT ); Tue, 22 Jan 2013 05:48:23 -0500 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MH000G2UWO3JLQ0@mailout4.samsung.com> for linux-mmc@vger.kernel.org; Tue, 22 Jan 2013 19:48:22 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.51]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 37.C6.03918.67E6EF05; Tue, 22 Jan 2013 19:48:22 +0900 (KST) X-AuditID: cbfee61a-b7f7d6d000000f4e-da-50fe6e765d04 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id B3.C6.03918.76E6EF05; Tue, 22 Jan 2013 19:48:07 +0900 (KST) Received: from DOTGIHJUN01 ([12.23.118.161]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MH0005F1WO7AR10@mmp2.samsung.com> for linux-mmc@vger.kernel.org; Tue, 22 Jan 2013 19:48:07 +0900 (KST) From: Seungwon Jeon To: linux-mmc@vger.kernel.org Cc: 'Chris Ball' , 'Sujit Reddy Thumma' , 'Adrian Hunter' References: <004801cdad17$498d9140$dca8b3c0$%jun@samsung.com> <201210191010.48776.heiko@sntech.de> <87liepq8qo.fsf@octavius.laptop.org> <201210292337.35620.heiko@sntech.de> In-reply-to: Subject: [PATCH 2/2] mmc: block: don't start new request when the card is removed Date: Tue, 22 Jan 2013 19:48:07 +0900 Message-id: <001e01cdf88d$f666ecb0$e334c610$%jun@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac22JgMPkQo3PX5PToiIfwakzap/IgAK/vjAAAITDcAQe3x9AA== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrNIsWRmVeSWpSXmKPExsVy+t8zY92yvH8BBvPm8Fsc+d/P6MDo8XmT XABjFJdNSmpOZllqkb5dAlfGpoPrWQpaOSo2/NjG0sB4gq2LkZNDQsBE4uK2y4wQtpjEhXvr geJcHEICyxglji/eywxTtGnPL3YQW0hgOqPEhhOxEEWzmCQ2r/oLNolNQEvi75s3YA0iArIS P/9cAIszC9RL3H6+FmrqBkaJ9T/vgq3jFOCRWPenE6xBWCBY4lXHYpYuRg4OFgFVic6TqiBh XgFbiePTlzBC2IISPybfAythFlCXmDIlF2K8vMTmNW+ZQcISQOFHf3UhLnCSuHH3AzNEiYjE vhfvGEEukBBYxC5xp+8eE0iCRUBA4tvkQywQvbISmw5AvSspcXDFDZYJjBKzkCyehbB4FpLF s5BsWMDIsopRNLUguaA4KT3XUK84Mbe4NC9dLzk/dxMjJKqkdjCubLA4xCjAwajEw2vx6G+A EGtiWXFl7iFGCQ5mJRFeweB/AUK8KYmVValF+fFFpTmpxYcYk4FuncgsJZqcD4z4vJJ4Q2Nj EzMTUxNzS1NzU9KElcR5GU89CRASSE8sSc1OTS1ILYLZ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bFNiKc5INNRiLipOBABpK45w HQMAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Current request can be started newly while handling the error. But if the card is removed, it's unnecessary to restart a request. This makes the extra error handling. Signed-off-by: Seungwon Jeon Acked-by: Jaehoon Chung Tested-by: Konstantin Dorfman --- drivers/mmc/card/block.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index f79b468..1170afe 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;