From patchwork Thu Nov 17 07:40:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 9433581 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 E7A5160238 for ; Thu, 17 Nov 2016 07:41:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D94EE292B0 for ; Thu, 17 Nov 2016 07:41:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE375292B3; Thu, 17 Nov 2016 07:41:00 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79E6C292B0 for ; Thu, 17 Nov 2016 07:41:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752197AbcKQHk7 (ORCPT ); Thu, 17 Nov 2016 02:40:59 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:58231 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751059AbcKQHk7 (ORCPT ); Thu, 17 Nov 2016 02:40:59 -0500 Received: from epcpsbgm1new.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OGR01SAEZZO5X60@mailout1.samsung.com> for linux-mmc@vger.kernel.org; Thu, 17 Nov 2016 16:40:43 +0900 (KST) X-AuditID: cbfee61a-f79916d0000062de-07-582d5efba263 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id E5.4F.25310.BFE5D285; Thu, 17 Nov 2016 16:40:43 +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 <0OGR00EHCZZUI940@mmp1.samsung.com>; Thu, 17 Nov 2016 16:40:42 +0900 (KST) From: Jaehoon Chung To: linux-mmc@vger.kernel.org Cc: ulf.hansson@linaro.org, shawn.lin@rock-chips.com, adrian.hunter@intel.com, Jaehoon Chung Subject: [PATCHv3 5/9] mmc: dw_mmc: call the dw_mci_prep_stop_abort() by default Date: Thu, 17 Nov 2016 16:40:37 +0900 Message-id: <20161117074041.8641-6-jh80.chung@samsung.com> X-Mailer: git-send-email 2.10.1 In-reply-to: <20161117074041.8641-1-jh80.chung@samsung.com> References: <20161117074041.8641-1-jh80.chung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrHLMWRmVeSWpSXmKPExsVy+t9jAd3fcboRBhM2slqcfLKGzeLGrzZW iyP/+xkt7jxZz2pxfG24A6vH4j0vmTzuXNvD5vF31n4Wj74tqxg9Pm+SC2CNcrPJSE1MSS1S SM1Lzk/JzEu3VQoNcdO1UFLIS8xNtVWK0PUNCVJSKEvMKQXyjAzQgINzgHuwkr5dglvGoeVL mAt2CFfceTWBuYHxEn8XIweHhICJxNqT4l2MnECmmMSFe+vZuhi5OIQEljJK3D7znBHC+cEo sXPjYnaQKjYBHYnt344zgdgiArISP/9cYAOxmQXKJVZ9OckKMlRYIECicycXSJhFQFXi8+MF YGFeASuJ2yejIHbJS1y4eooFJMwpYC3R80sBJCwEVHH63De2CYy8CxgZVjFKpBYkFxQnpeca 5qWW6xUn5haX5qXrJefnbmIEh+0zqR2MB3e5H2IU4GBU4uGdcFsnQog1say4MvcQowQHs5II r0iQboQQb0piZVVqUX58UWlOavEhRlOgsyYyS4km5wNjKq8k3tDE3MTc2MDC3NLSxEhJnLdx 9rNwIYH0xJLU7NTUgtQimD4mDk6pBsaZvev3norPXjb1+JWcQv3mgurXN6UP/Ekqnpm8cYV9 Tjp7Q8Lrug0vZZa1bqrP9F8cwm7jJG5jdX49+49U+yf1U2PcvifG9bSa5vtxetZP/sm92zhE Z8O6qH3Gq7/+1d7V0Fegx7OWnU1ZuU6g++mKVReyFwWracmG26uWPrj09fd5vf33WpVYijMS DbWYi4oTAZQ6hG9xAgAA X-MTR: 20000000000000000@CPGS Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.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 Tested-by: Heiko Stuebner Reviewed-by: Shawn Lin --- 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 f592280..f01b5ce 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;