From patchwork Fri Aug 30 15:14:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seungwon Jeon X-Patchwork-Id: 2852128 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 29EEDC0AB5 for ; Fri, 30 Aug 2013 15:14:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2136C2018D for ; Fri, 30 Aug 2013 15:14:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9530020488 for ; Fri, 30 Aug 2013 15:14:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756426Ab3H3POj (ORCPT ); Fri, 30 Aug 2013 11:14:39 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:38718 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756327Ab3H3POj (ORCPT ); Fri, 30 Aug 2013 11:14:39 -0400 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MSC003RBNO9SJM0@mailout2.samsung.com> for linux-mmc@vger.kernel.org; Sat, 31 Aug 2013 00:14:38 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.47]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id 21.3D.29948.ED6B0225; Sat, 31 Aug 2013 00:14:38 +0900 (KST) X-AuditID: cbfee691-b7f4a6d0000074fc-ee-5220b6debc22 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 82.71.09055.ED6B0225; Sat, 31 Aug 2013 00:14:38 +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 <0MSC00D02NOE6530@mmp2.samsung.com>; Sat, 31 Aug 2013 00:14:38 +0900 (KST) From: Seungwon Jeon To: linux-mmc@vger.kernel.org Cc: 'Chris Ball' , 'Jaehoon Chung' References: In-reply-to: Subject: [PATCH 22/22] mmc: dw_mmc: fix the transfer termination in IDMAC mode Date: Sat, 31 Aug 2013 00:14:38 +0900 Message-id: <001901cea593$a4a2c7b0$ede85710$%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: Ac03z3aCvVFr8FaITt2vKVQKst76fw3OcIrwS9fJ1BAByUIdcA== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrIIsWRmVeSWpSXmKPExsVy+t8zfd172xSCDLbuFbfY/nojm8WNX22s Fkf+9zM6MHscurKW0aNvyypGj8+b5AKYo7hsUlJzMstSi/TtErgyLr/5wFjQy12xdMtNlgbG 9ZxdjJwcEgImEtuftbNA2GISF+6tZ+ti5OIQEljGKHHl2GUWmKIFH5azQySmM0qsWbMFyvnD KLH/xzpGkCo2AS2Jv2/eMIPYIgKyEj//XGADsZkFvCVezV8DVMMB1MAtsbo5CCTMKcAjse5P J1i5sICfxPzJn8GWsQioSnzecgLM5hWwlZjSfYcJwhaU+DH5HgvIGGYBdYkpU3IhpstLbF7z lhkkLAEUfvRXF+IAJ4mzTQcZIUpEJPa9eMcIcrGEwD52ifcfZrJDrBKQ+Db5EAtEr6zEpgPM EO9KShxccYNlAqPELCSLZyEsnoVk8SwkGxYwsqxiFE0tSC4oTkovMtUrTswtLs1L10vOz93E CIm+iTsY7x+wPsSYDLR9IrOUaHI+MHrzSuINjc2M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TpVHPSUumF/mzfv2udNNrpXbKoQ9f/GiOZvVdrtGXLDUnvV2itPM1dqV+kuTw6eL hEbmKhzmVmIpzkg01GIuKk4EABKN5UQxAwAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In IDMAC mode EVENT_XFER_COMPLETE is set when RI/TI of last descriptor is done. So if errors are happened in the middle of data transfers, 'dw_mci_stop_dma' during error handing can be called and eventually prevents this flag to be set. This results in permanent wait for EVENT_XFER_COMPLETE in 'dw_mci_tasklet_func'. Therefore, if dma running is stopped forcibly, EVENT_XFER_COMPLETE should be set. Reported-by: Bing Zhao Signed-off-by: Doug Anderson Signed-off-by: Seungwon Jeon Tested-by: Alim Akhtar Acked-by: Jaehoon Chung --- drivers/mmc/host/dw_mmc.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 5d9c7e5..10e39ba 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -345,10 +345,10 @@ static void dw_mci_stop_dma(struct dw_mci *host) if (host->using_dma) { host->dma_ops->stop(host); host->dma_ops->cleanup(host); - } else { - /* Data transfer was stopped by the interrupt handler */ - set_bit(EVENT_XFER_COMPLETE, &host->pending_events); } + + /* Data transfer was stopped by the interrupt handler */ + set_bit(EVENT_XFER_COMPLETE, &host->pending_events); } static int dw_mci_get_dma_dir(struct mmc_data *data)