From patchwork Thu Nov 3 06:21:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 9410411 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7EB9C60573 for ; Thu, 3 Nov 2016 06:24:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 705372A4FF for ; Thu, 3 Nov 2016 06:24:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 64FF52A516; Thu, 3 Nov 2016 06:24:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2AA652A4FF for ; Thu, 3 Nov 2016 06:24:37 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c2BS0-0005QN-Hz; Thu, 03 Nov 2016 06:24:36 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c2BPj-0003FB-JK; Thu, 03 Nov 2016 06:22:18 +0000 Received: from epcpsbgm1new.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OG101AYWYZOI240@mailout2.samsung.com>; Thu, 03 Nov 2016 15:21:47 +0900 (KST) X-AuditID: cbfee61a-f79916d0000062de-cc-581ad77bd3d4 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id C8.8B.25310.B77DA185; Thu, 3 Nov 2016 15:21:47 +0900 (KST) Received: from localhost.localdomain ([10.113.62.216]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OG100J7YZ02LAA0@mmp1.samsung.com>; Thu, 03 Nov 2016 15:21:47 +0900 (KST) From: Jaehoon Chung To: linux-mmc@vger.kernel.org Subject: [PATCH 05/13] mmc: dw_mmc: call the dw_mci_prep_stop_abort() by default Date: Thu, 03 Nov 2016 15:21:27 +0900 Message-id: <20161103062135.10697-6-jh80.chung@samsung.com> X-Mailer: git-send-email 2.10.1 In-reply-to: <20161103062135.10697-1-jh80.chung@samsung.com> References: <20161103062135.10697-1-jh80.chung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjkeLIzCtJLcpLzFFi42I5/e+xgG71dakIg1d/9S3mHznHavH/0WtW ixu/2lgtzp/fwG6x6fE1VovLu+awWRz5389o8enBf2aLGef3MVm07j3CbnHnyXpWi+Nrwx14 PDat6mTzuHNtD5vH5iX1Hn9n7Wfx6NuyitFj+7V5zB6fN8kFsEe52WSkJqakFimk5iXnp2Tm pdsqhYa46VooKeQl5qbaKkXo+oYEKSmUJeaUAnlGBmjAwTnAPVhJ3y7BLePE/cXMBd3CFZM3 pDYwruLvYuTkkBAwkXi5eB8ThC0mceHeerYuRi4OIYGljBJzjj1nhHB+MEp8P/yVGaSKTUBH Yvu342AdIgKyEj//XADrYBY4yCTxf9JuFpCEsECAxI2mFawgNouAqsSZnVPBmnkFrCVOz1/D DLFOXuLC1VNg9ZwCNhITjzSD1QsB1dw6vJJpAiPvAkaGVYwSqQXJBcVJ6bmGeanlesWJucWl eel6yfm5mxjBcfFMagfjwV3uhxgFOBiVeHg/qEhFCLEmlhVX5h5ilOBgVhLh3XUFKMSbklhZ lVqUH19UmpNafIjRFOiwicxSosn5wJjNK4k3NDE3MTc2sDC3tDQxUhLnbZz9LFxIID2xJDU7 NbUgtQimj4mDU6qB8YLdZpO5UgINHhvDO+60LU/SiLuadeJy4gGDIp/eNwW3Ezd5rVG/kPL0 76JbRT/2OvnP4TVyu5Rv+PP0/GTP9JMMRf7Hmld9X5xTs0QipVb3sWPuPxvHucaXe5rfcnr9 56yV0rwnoDfh6P+joZL7ay+r17y9MunAFObYUz/itJVefpI54ZtipcRSnJFoqMVcVJwIAMHb 04ChAgAA X-MTR: 20000000000000000@CPGS X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161102_232215_988379_E38E8BC2 X-CRM114-Status: GOOD ( 11.05 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, ulf.hansson@linaro.org, linux-samsung-soc@vger.kernel.org, heiko@sntech.de, shawn.lin@rock-chips.com, linux-kernel@vger.kernel.org, krzk@kernel.org, Jaehoon Chung , linux-rockchip@lists.infradead.org, robh+dt@kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP stop_cmdr should be set to values relevant to stop command. It migth be assigned to values whatever there is mrq->stop or not. Then it doesn't need to use dw_mci_prepare_command(). It's enough to use the prep_stop_abort for preparing stop command. Signed-off-by: Jaehoon Chung --- drivers/mmc/host/dw_mmc.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 23fc505..16df93b 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -385,7 +385,7 @@ static void dw_mci_start_command(struct dw_mci *host, static inline void send_stop_abort(struct dw_mci *host, struct mmc_data *data) { - struct mmc_command *stop = data->stop ? data->stop : &host->stop_abort; + struct mmc_command *stop = &host->stop_abort; dw_mci_start_command(host, stop, host->stop_cmdr); } @@ -1277,10 +1277,7 @@ static void __dw_mci_start_request(struct dw_mci *host, spin_unlock_irqrestore(&host->irq_lock, irqflags); } - if (mrq->stop) - host->stop_cmdr = dw_mci_prepare_command(slot->mmc, mrq->stop); - else - host->stop_cmdr = dw_mci_prep_stop_abort(host, cmd); + host->stop_cmdr = dw_mci_prep_stop_abort(host, cmd); } static void dw_mci_start_request(struct dw_mci *host, @@ -1890,8 +1887,7 @@ static void dw_mci_tasklet_func(unsigned long priv) if (test_and_clear_bit(EVENT_DATA_ERROR, &host->pending_events)) { dw_mci_stop_dma(host); - if (data->stop || - !(host->data_status & (SDMMC_INT_DRTO | + if (!(host->data_status & (SDMMC_INT_DRTO | SDMMC_INT_EBE))) send_stop_abort(host, data); state = STATE_DATA_ERROR; @@ -1927,8 +1923,7 @@ static void dw_mci_tasklet_func(unsigned long priv) if (test_and_clear_bit(EVENT_DATA_ERROR, &host->pending_events)) { dw_mci_stop_dma(host); - if (data->stop || - !(host->data_status & (SDMMC_INT_DRTO | + if (!(host->data_status & (SDMMC_INT_DRTO | SDMMC_INT_EBE))) send_stop_abort(host, data); state = STATE_DATA_ERROR; @@ -2004,7 +1999,7 @@ static void dw_mci_tasklet_func(unsigned long priv) host->cmd = NULL; host->data = NULL; - if (mrq->stop) + if (!mrq->sbc && mrq->stop) dw_mci_command_complete(host, mrq->stop); else host->cmd_status = 0;