From patchwork Wed Mar 9 02:34:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Lin X-Patchwork-Id: 8541651 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AB9419F7CA for ; Wed, 9 Mar 2016 02:43:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BCEA3201BC for ; Wed, 9 Mar 2016 02:43:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D4DFF2017D for ; Wed, 9 Mar 2016 02:43:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750766AbcCICnb (ORCPT ); Tue, 8 Mar 2016 21:43:31 -0500 Received: from lucky1.263xmail.com ([211.157.147.133]:36699 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750765AbcCICnb (ORCPT ); Tue, 8 Mar 2016 21:43:31 -0500 Received: from shawn.lin?rock-chips.com (unknown [192.168.167.97]) by lucky1.263xmail.com (Postfix) with SMTP id D2DCD5151D; Wed, 9 Mar 2016 10:43:23 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-ADDR-CHECKED: 0 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.263.net (Postfix) with ESMTP id A7158268D4; Wed, 9 Mar 2016 10:43:21 +0800 (CST) X-RL-SENDER: shawn.lin@rock-chips.com X-FST-TO: jh80.chung@samsung.com X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: shawn.lin@rock-chips.com X-UNIQUE-TAG: <24208da6b42140e4d47f00ff3b1da910> X-ATTACHMENT-NUM: 0 X-SENDER: lintao@rock-chips.com X-DNS-TYPE: 0 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (Postfix) whith ESMTP id 22337Z8Q59R; Wed, 09 Mar 2016 10:43:22 +0800 (CST) From: Shawn Lin To: Jaehoon Chung , Ulf Hansson Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Shawn Lin Subject: [PATCH 2/2] mmc: dw_mmc: avoid using dmaengine_terminate_all Date: Wed, 9 Mar 2016 10:34:46 +0800 Message-Id: <1457490886-18092-1-git-send-email-shawn.lin@rock-chips.com> X-Mailer: git-send-email 1.8.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 dmaengine_terminate_all is deprecated and should be replaced by more explicit synchronous and asynchronous terminate functions. This change is based on the commit b36f09c3c441 ("dmaengine: Add transfer termination synchronization support"). Currently dw_mci_stop_dma may be called under the spinlock, let's migrate dmaengine_terminate_all to async terminate. This could avoid the race condition of use-after-free resouce of dmaengine once slave-dma driver implement the synchronize method. Signed-off-by: Shawn Lin --- drivers/mmc/host/dw_mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 242f9a0..45a406f 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -680,7 +680,7 @@ static const struct dw_mci_dma_ops dw_mci_idmac_ops = { static void dw_mci_edmac_stop_dma(struct dw_mci *host) { - dmaengine_terminate_all(host->dms->ch); + dmaengine_terminate_async(host->dms->ch); } static int dw_mci_edmac_start_dma(struct dw_mci *host,