From patchwork Fri Nov 18 11:16:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 9436223 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 ACCA760469 for ; Fri, 18 Nov 2016 11:17:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9072A29880 for ; Fri, 18 Nov 2016 11:17:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 832BE29885; Fri, 18 Nov 2016 11:17:08 +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 C8BFF29880 for ; Fri, 18 Nov 2016 11:17:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752396AbcKRLRE (ORCPT ); Fri, 18 Nov 2016 06:17:04 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:51098 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752336AbcKRLRE (ORCPT ); Fri, 18 Nov 2016 06:17:04 -0500 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 <0OGU01APV4NW4940@mailout2.samsung.com> for linux-mmc@vger.kernel.org; Fri, 18 Nov 2016 20:17:01 +0900 (KST) X-AuditID: cbfee61a-f79916d0000062de-03-582ee32ca462 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id D8.84.25310.C23EE285; Fri, 18 Nov 2016 20:17:01 +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 <0OGU00GDJ4OC1620@mmp1.samsung.com>; Fri, 18 Nov 2016 20:17:00 +0900 (KST) From: Jaehoon Chung To: linux-mmc@vger.kernel.org Cc: ulf.hansson@linaro.org, shawn.lin@rock-chips.com, Jaehoon Chung Subject: [PATCHv2] mmc: dw_mmc: fix the error handling for dma operation Date: Fri, 18 Nov 2016 20:16:59 +0900 Message-id: <20161118111659.21483-1-jh80.chung@samsung.com> X-Mailer: git-send-email 2.10.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrALMWRmVeSWpSXmKPExsVy+t9jAV3dx3oRBlf3Mlvc+NXGanHkfz+j xZ0n61ktjq8Nd2DxuHNtD5vH31n7WTz6tqxi9Pi8SS6AJcrNJiM1MSW1SCE1Lzk/JTMv3VYp NMRN10JJIS8xN9VWKULXNyRISaEsMacUyDMyQAMOzgHuwUr6dgluGdNP7mcrmMpZ0bTsCWMD 43H2LkZODgkBE4l5nTegbDGJC/fWs3UxcnEICSxllJi7dDqU84NR4uj6hUwgVWwCOhLbvx0H s0UEZCV+/rnABmIzC8RJLDr6E2ySsICHxOGuc6wgNouAqsTsI/+ZQWxeAWuJv5cesEBsk5e4 cPUUywRG7gWMDKsYJVILkguKk9JzDfNSy/WKE3OLS/PS9ZLzczcxgkPvmdQOxoO73A8xCnAw KvHwRlzTjRBiTSwrrsw9xCjBwawkwjv/vl6EEG9KYmVValF+fFFpTmrxIUZToAMmMkuJJucD 4yKvJN7QxNzE3NjAwtzS0sRISZy3cfazcCGB9MSS1OzU1ILUIpg+Jg5OqQZGbkXfDHOts0t9 DreoPvHesPuG26PDYn/du1OmTevirtnbbCdd8zq20vXF1itRC7bzMNrFp+iWy2osurX622SF JKWpOq+mBr9ZlZqTWqRjGXzh87EV3iFGeTsUEgqlWya+XHe1WU6G7brfpd1Ga3ye9k/29Ww/ v+tX19WW/MiD7/6w8m8RDTqlxFKckWioxVxUnAgAxFN+hlMCAAA= 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 When dma->start is failed,then it has to fall back to PIO mode for current transfer. But Host controller was already set to bits relevant to DMA operation. If needs to use the PIO mode, Host controller has to stop the DMA operation. (It's more stable than now.) When it occurred error, it's not running any request. Fixes: 3fc7eaef44db ("mmc: dw_mmc: Add external dma interface support") Signed-off-by: Jaehoon Chung Reviewed-by: Shawn Lin --- Changelog on V2 - Change the Fiexes Commit Id drivers/mmc/host/dw_mmc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 50a674b..df478ae 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1058,6 +1058,7 @@ static int dw_mci_submit_data_dma(struct dw_mci *host, struct mmc_data *data) spin_unlock_irqrestore(&host->irq_lock, irqflags); if (host->dma_ops->start(host, sg_len)) { + host->dma_ops->stop(host); /* We can't do DMA, try PIO for this one */ dev_dbg(host->dev, "%s: fall back to PIO mode for current transfer\n",