From patchwork Thu Dec 20 10:27:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seungwon Jeon X-Patchwork-Id: 1899281 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 CFD80DF23A for ; Thu, 20 Dec 2012 10:27:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751431Ab2LTK1U (ORCPT ); Thu, 20 Dec 2012 05:27:20 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:58822 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750956Ab2LTK1T (ORCPT ); Thu, 20 Dec 2012 05:27:19 -0500 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MFB008CCRPCG5Q0@mailout4.samsung.com> for linux-mmc@vger.kernel.org; Thu, 20 Dec 2012 19:27:17 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.51]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id DD.8C.12699.508E2D05; Thu, 20 Dec 2012 19:27:17 +0900 (KST) X-AuditID: cbfee61b-b7f616d00000319b-e1-50d2e8051e87 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 9D.8C.12699.508E2D05; Thu, 20 Dec 2012 19:27:17 +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 <0MFB007GSRPG8A00@mmp2.samsung.com> for linux-mmc@vger.kernel.org; Thu, 20 Dec 2012 19:27:17 +0900 (KST) From: Seungwon Jeon To: linux-mmc@vger.kernel.org Cc: 'Chris Ball' , 'Per Forlin' , 'Konstantin Dorfman' References: In-reply-to: Subject: [PATCH] mmc: queue: exclude asynchronous transfer for special request Date: Thu, 20 Dec 2012 19:27:16 +0900 Message-id: <003c01cdde9c$95883ad0$c098b070$%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: Ac03z3aCvVFr8FaITt2vKVQKst76fw3Ogf7QC4iI1hAADVzV0BBOVxiA Content-language: ko DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrKIsWRmVeSWpSXmKPExsVy+t8zY13WF5cCDCZuFbc48r+f0YHR4/Mm uQDGKC6blNSczLLUIn27BK6MhuVrmAsOcVVc777G1sA4n6OLkZNDQsBE4uzLrWwQtpjEhXvr gWwuDiGBZYwSpx9fZ+li5AAr2vffESI+nVFiy5MGZghnFpPEticn2EG62QS0JP6+ecMMYosI yEr8/HMBbCqzQKXEra1rwAYJCXBLrG4OAglzCvBIrPvTCVYuLOAnsXzGL1YQm0VAVeL19PVM IDavgK3E7k9zGSFsQYkfk++xQIxUl5g0bxEzhC0vsXnNW2aIO9UlHv3VhbjATWLi39PsECUi EvtevGOEGC8g8W3yIai3ZCU2HQD7REJgGbvExKkrGCHhIClxcMUNlgmMErOQbJ6FZPMsJJtn IVmxgJFlFaNoakFyQXFSeq6RXnFibnFpXrpecn7uJkZIXEnvYFzVYHGIUYCDUYmHd9G0SwFC rIllxZW5hxglOJiVRHgX3roYIMSbklhZlVqUH19UmpNafIjRB+jyicxSosn5wJjPK4k3NDY2 MTMxNTG3NDU3xSGsJM7b7JESICSQnliSmp2aWpBaBDOOiYNTqoGxrVnP4hSfyauPEuKHTutc 7p6RlP/bX5DXYPods3/qIj+vKM+du97ted/a815avg7L3d/+myluqaR5KX5J2vyZuyUCo6Ye b9phVfVJ8MQxMaspGZs42/bteHDAoNnl30WrfZOZhdm8bsXJtTFnFN67LbpGlnHdxmfhR2el uB/hrPc1yJPsSO5RYinOSDTUYi4qTgQADw8nGNgCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrCIsWRmVeSWpSXmKPExsVy+t9jQV3WF5cCDL7u4bY48r+f0YHR4/Mm uQDGqAZGm4zUxJTUIoXUvOT8lMy8dFsl7+B453hTMwNDXUNLC3MlhbzE3FRbJRefAF23zByg qUoKZYk5pUChgMTiYiV9O0wTQkPcdC1gGiN0fUOC4HqMDNBAwjrGjIbla5gLDnFVXO++xtbA OJ+ji5GDQ0LARGLff8cuRk4gU0ziwr31bF2MXBxCAtMZJbY8aWCGcGYxSWx7coIdpIpNQEvi 75s3zCC2iICsxM8/F9hAbGaBSolbW9ewgAwVEuCWWN0cBBLmFOCRWPenE6xcWMBPYvmMX6wg NouAqsTr6euZQGxeAVuJ3Z/mMkLYghI/Jt9jgRipLjFp3iJmCFteYvOat8wQN6tLPPqrC3GB m8TEv6fZIUpEJPa9eMc4gVFoFpJJs5BMmoVk0iwkLQsYWVYxiqYWJBcUJ6XnGukVJ+YWl+al 6yXn525iBEftM+kdjKsaLA4xCnAwKvHwLpp2KUCINbGsuDL3EKMEB7OSCO/CWxcDhHhTEiur Uovy44tKc1KLDzH6AD06kVlKNDkfmFDySuINjU3MjCyNzCyMTMzNcQgrifM2e6QECAmkJ5ak ZqemFqQWwYxj4uCUamAsUSyt2Vb9aY7T9wL581N+XJ6T3FvySqX099Ipmx7+vsmtd1Va4miZ iWN7x407PHXmv158cvQJYZdq0Hpt2piQ9HZmQvbNRReUS7T7StqSDRrf5nKn7Chs7zD763my qvdx00vZv43CepEr9y94WfDDnNnm9+91xi+5Zya/mSPL5spkF8u/TViJpTgj0VCLuag4EQCk fhTHBwMAAA== X-CFilter-Loop: Reflected Sender: linux-mmc-owner@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 --- drivers/mmc/card/queue.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c index fadf52e..a71db7a 100644 --- a/drivers/mmc/card/queue.c +++ b/drivers/mmc/card/queue.c @@ -58,6 +58,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 +68,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 & REQ_DISCARD || cmd_flags & REQ_FLUSH) + mq->mqrq_cur->req = NULL; + mq->mqrq_prev->brq.mrq.data = NULL; mq->mqrq_prev->req = NULL; tmp = mq->mqrq_prev;