From patchwork Wed Dec 26 01:40:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seungwon Jeon X-Patchwork-Id: 1910251 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id D4C6BDF23A for ; Wed, 26 Dec 2012 01:40:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752701Ab2LZBkV (ORCPT ); Tue, 25 Dec 2012 20:40:21 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:45897 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752639Ab2LZBkU (ORCPT ); Tue, 25 Dec 2012 20:40:20 -0500 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MFM00KR17ANDXE0@mailout2.samsung.com> for linux-mmc@vger.kernel.org; Wed, 26 Dec 2012 10:40:18 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.51]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 39.2C.12699.2855AD05; Wed, 26 Dec 2012 10:40:18 +0900 (KST) X-AuditID: cbfee61b-b7f616d00000319b-4c-50da5582611a Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id D8.2C.12699.2855AD05; Wed, 26 Dec 2012 10:40:18 +0900 (KST) Received: from DOTGIHJUN01 ([12.23.118.161]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MFM00KRV7B6IBG0@mmp1.samsung.com> for linux-mmc@vger.kernel.org; Wed, 26 Dec 2012 10:40:18 +0900 (KST) From: Seungwon Jeon To: linux-mmc@vger.kernel.org Cc: 'Chris Ball' , 'Per Forlin' , 'Konstantin Dorfman' References: In-reply-to: Subject: [PATCH v2] mmc: queue: exclude asynchronous transfer for special request Date: Wed, 26 Dec 2012 10:40:17 +0900 Message-id: <000701cde309$f5ed8fd0$e1c8af70$%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: Ac03z3aCvVFr8FaITt2vKVQKst76fw3Ogf7QC4iI1hAADVzV0BBOVxiAARu2RyA= Content-language: ko DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCIsWRmVeSWpSXmKPExsVy+t8zY92m0FsBBp/aNSyO/O9ndGD0+LxJ LoAxissmJTUnsyy1SN8ugSvj6YUjjAU/uSueXvnB3sC4hrOLkZNDQsBE4sjKFUwQtpjEhXvr 2boYuTiEBJYxSuyef50Vpmji1reMEIlFjBL3Xu1lh3BmMUl8eXeCGaSKTUBL4u+bN2C2iICs xM8/F9hAbGaBSolbW9ewdDFyADVwS6xuDgIJcwrwSKz70wlWLiwQLPH18AMwm0VAVWLGhHNg Nq+ArcS+NWdYIWxBiR+T74GNYRZQl5gyJRdiurzE5jVvmUHCEkDhR391IQ7wk7h7fSIzRImI xL4X7xghpgtIfJt8iAWiXFZi0wFmkEckBOaxS/QcugL1rqTEwRU3WCYwSsxCsngWwuJZSBbP QrJhASPLKkbR1ILkguKk9FwjveLE3OLSvHS95PzcTYyQqJLewbiqweIQowAHoxIPL+evmwFC rIllxZW5hxglOJiVRHidPwKFeFMSK6tSi/Lji0pzUosPMfoAHT6RWUo0OR8Y8Xkl8YbGxiZm JqYm5pam5qY4hJXEeZs9UgKEBNITS1KzU1MLUotgxjFxcEo1MM5Xto+95WI3/ai/4u6dr3If TjqS2lQ2z87a6amDWH9DMd/Bf+x1s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vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Unlike normal r/w request, special requests(discard, flush) is finished with a one-time issue_fn. Request change to mqrq_prev makes unnecessary call. Signed-off-by: Seungwon Jeon Reviewed-by: Konstantin Dorfman --- drivers/mmc/card/queue.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c index fadf52e..c7e8716 100644 --- a/drivers/mmc/card/queue.c +++ b/drivers/mmc/card/queue.c @@ -24,6 +24,8 @@ #define MMC_QUEUE_SUSPENDED (1 << 0) +#define MMC_REQ_SPECIAL_MASK (REQ_DISCARD | REQ_FLUSH) + /* * Prepare a MMC request. This just filters out odd stuff. */ @@ -58,6 +60,7 @@ static int mmc_queue_thread(void *d) do { struct request *req = NULL; struct mmc_queue_req *tmp; + unsigned int cmd_flags = 0; spin_lock_irq(q->queue_lock); set_current_state(TASK_INTERRUPTIBLE); @@ -67,12 +70,19 @@ static int mmc_queue_thread(void *d) if (req || mq->mqrq_prev->req) { set_current_state(TASK_RUNNING); + cmd_flags = req ? req->cmd_flags : 0; mq->issue_fn(mq, req); /* * Current request becomes previous request * and vice versa. + * In case of special requests, current request + * has been finished. Do not remain it to previous + * request. */ + if (cmd_flags & MMC_REQ_SPECIAL_MASK) + mq->mqrq_cur->req = NULL; + mq->mqrq_prev->brq.mrq.data = NULL; mq->mqrq_prev->req = NULL; tmp = mq->mqrq_prev;