Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7935441imu; Mon, 3 Dec 2018 23:25:35 -0800 (PST) X-Google-Smtp-Source: AFSGD/V5PGQ96qX1aDBSPYo4f9YxojdwdbxKnyDaJpS7AgcArZpvR40lFtjFuu+ffxGtHuPohx2/ X-Received: by 2002:a63:a16:: with SMTP id 22mr15976351pgk.318.1543908335890; Mon, 03 Dec 2018 23:25:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543908335; cv=none; d=google.com; s=arc-20160816; b=O261GVn4nmRM/WM3pCjmuk+s8BcoHyBh02+F9tf9+3osm27DGRjDVfT8hMyZZ4LuAx H1cZV8Xw77E62KswZNkmhC9w6KNlv5pBaelInrqNniigUKdzPmVP79AXWzTm8SLKQxiq aX2Fr3nKgcZKPE0rxtCBYwZO5XfUjqsLiiweSbyXExXwyROsD6n8FwptEP7JRBpKgXP9 J/blp5jmqT1ofE9dZNdR8clzCnXZjsjYapteyOByZxXbEvR8KpqMg0iAwr3o2UPQcS8m aNJ++q0ntiXUXwdYPR7izNE2FniF/HbwKQJcOC0nqh+x38K8+YPjC8fdW2yxyS+Ty367 7YNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=5dwK9Gc1ilATX5PZtGQWTIvlOupWvPV8pyzXonNFRrQ=; b=vIE0EhAC87uk3HSTGz+ZzWSndCsdHzx8DmqVyIU3gTD9JjDqJxRwYl5Y0v3ZFSAUEb R+5M1YIQ8oEGx3edo0uy8Z1mdEhgLW5BeNlmREkvRUKqlFSmSorG5yw6lpYrhYsqXJAw uo9SGG+GbEcqRPuIJBMekIHdhSzrkIQ0cDrF7GO1uAw8jv8hif9ououEPNSBrlBC8aKI nrMDB+tZ7Tn3Cjk3vwgXWlKAg0RfPpnI7mgpnMKUHhhcBQ/9CmTAZUtvGeJ3qNzau/8c Qt8KNDjrJxOsVVM7Lhr2ASkDQGCiukuijrA62ssf+TpkOr4yEkbokz20I2rS+Jtc4Epj oszw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ep2qBWhH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e89si17949894plb.401.2018.12.03.23.25.21; Mon, 03 Dec 2018 23:25:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ep2qBWhH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726054AbeLDHYl (ORCPT + 99 others); Tue, 4 Dec 2018 02:24:41 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:37851 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725976AbeLDHYl (ORCPT ); Tue, 4 Dec 2018 02:24:41 -0500 Received: by mail-pl1-f195.google.com with SMTP id b5so7854526plr.4 for ; Mon, 03 Dec 2018 23:24:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=5dwK9Gc1ilATX5PZtGQWTIvlOupWvPV8pyzXonNFRrQ=; b=Ep2qBWhHgvCqDyTB80T3hNTLTnvOkVG7PBahc5Qk72N+Df2qAfE2XbE+XKXXSVKyw6 H7HSn/V/trwoWDd4Nmi+6j0ea5B+pSAdyDWWFK3EDVPsmkwWg3FF2VoBKj5A2J3R/pG+ Q+Zj6CSC95OyvWWLamedhEgFy4lWJ/zBBgQxg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=5dwK9Gc1ilATX5PZtGQWTIvlOupWvPV8pyzXonNFRrQ=; b=Ea4CMWX+bvZ2uoAvOdatFZILjtxRgluHRbrT/qNEEXs5tc0OMh01fL4WvGZRPDTpQA iPlwYYu5ES/Qy28HhZ7KRXhb99UrW9iOc865nBz9TkxBpJxVV3MIRMX45i0Fxhf1sTS9 +Uga51iUBjY3CwXDAsUs1B9oi5ExTRILvVOmGx3Rx7BxnlvZScOvT+Y1+DLpd4TiznU9 CGUKL+TyKdCz7JE5tMo/ThwgliIJ5ejUPcFqxIwMArDGosg0t1BURscLKMbzoBNPew1h +1d++tfFmLCqsaZO+pQuzoRXjE1U/xaDTScCS+867gxxqH9kopsF9KVSb8IIcZWaAQM2 J/Mg== X-Gm-Message-State: AA+aEWaZrNTLZ3muSa3o02xmKUhfwWB047OiBEecbiRCK9J0iCMf7diK bZgegRqPyB5W+bSTkjSX/PEVZA== X-Received: by 2002:a17:902:bf0c:: with SMTP id bi12mr18526341plb.0.1543908279641; Mon, 03 Dec 2018 23:24:39 -0800 (PST) Received: from ubt.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id g136sm22705943pfb.154.2018.12.03.23.24.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 03 Dec 2018 23:24:38 -0800 (PST) From: Chunyan Zhang To: Ulf Hansson , Adrian Hunter , Faiz Abbas Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann , Mark Brown , Kishon Vijay Abraham I , Sekhar Nori , Chunyan Zhang Subject: [PATCH V3 0/3] Add support for using external dma in SDHCI Date: Tue, 4 Dec 2018 15:24:27 +0800 Message-Id: <1543908270-13953-1-git-send-email-zhang.chunyan@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently the generic SDHCI code in the Linux kernel supports the SD standard DMA integrated into the host controller but does not have any support for external DMA controllers implemented using dmaengine meaning that custom code is needed for any systems that use a generic DMA controller with SDHCI which in practice means any SDHCI controller that doesn't have an integrated DMA controller so we should have this as a generic feature. There are already a number of controller specific drivers that have dmaengine code, and some could use sdhci.c actually, but needed to implement mmc_ops->request() in their specific driver for sending command with external dma using dmaengine framework, with this patchset, them will take advantage of the generic support. TI's omap controller is the case as an example. Any comments are very appreciated. Thanks, Chunyan Changes from v2 (https://lkml.org/lkml/2018/11/12/1936): * Remove CONFIG_EXTERNAL_DMA prompt and help graph; * Add checking for cmd->data; * Select MMC_SDHCI_EXTERNAL_DMA for MMC_SDHCI_OMAP; * Add checking if there's 'dmas' in device tree before decide using external dma. Changes from v1 (https://lkml.org/lkml/2018/11/5/110): (The code on patch 1/3 only was revised) * Address comments from Arnd: - Release channel when failed to request it unconditionally; - Skip warning message if get EPROBE_DEFER; * Address Andrian's comments: - Replace extdma with external_dma; - Add release dma resources in sdhci_cleanup_host() and sdhci_remove_host(); - Release dma resources once dmaengine_submit() failed. - Put rx/tx_chan in struct sdhci_host, and removed unused structure. * Fall back to the DMA/PIO which standard SDHCI supports, if sdhci_external_dma_setup() or sdhci_external_dma_init failed; Chunyan Zhang (3): mmc: sdhci: add support for using external DMA devices mmc: sdhci-omap: Add using external dma dt-bindings: sdhci-omap: Add example for using external dma .../devicetree/bindings/mmc/sdhci-omap.txt | 7 + drivers/mmc/host/Kconfig | 4 + drivers/mmc/host/sdhci-omap.c | 10 ++ drivers/mmc/host/sdhci.c | 185 ++++++++++++++++++++- drivers/mmc/host/sdhci.h | 8 + 5 files changed, 213 insertions(+), 1 deletion(-) -- 2.7.4