From patchwork Mon Nov 12 07:26:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Zhang X-Patchwork-Id: 10678243 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5F2A214DB for ; Mon, 12 Nov 2018 07:26:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E831297FE for ; Mon, 12 Nov 2018 07:26:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 30EEB29898; Mon, 12 Nov 2018 07:26:39 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,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 C740329810 for ; Mon, 12 Nov 2018 07:26:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726971AbeKLRSf (ORCPT ); Mon, 12 Nov 2018 12:18:35 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:37040 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726912AbeKLRSf (ORCPT ); Mon, 12 Nov 2018 12:18:35 -0500 Received: by mail-pf1-f194.google.com with SMTP id u3-v6so1206182pfm.4 for ; Sun, 11 Nov 2018 23:26:37 -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=MaJ6kGoogNk7TlYPNyNVU1hBPKpkcHrSdo7gFd6mNXY=; b=i6FQS/oWgUbqWL4dd2fuReD/+kt+Dk/1X6VQtG5Wk9UZtD1KfMPh4987+yMuD0tAwd 9i8j/dVBixAFFS6DmupIKtFvbupUhbNVM37e2hVFyFAgwTjbUcDCQZBrtVI/ehX+jlgf cL0MsQtSSQZw0AYHZnYZEFpZmb+qi/vSz+94k= 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=MaJ6kGoogNk7TlYPNyNVU1hBPKpkcHrSdo7gFd6mNXY=; b=tT8WSNsNTb++d5QqpKrHZfthiCIAzQRHPZUHswnLiKU9DVJZ5W+9LmH3mzB4+I5wc/ WoAG08SEdzfOWT2wdUmjx/hJTsJ3K6tCY9ooPAzAtP43HMdmFqO70LaiP5e6ofZwXe7L 49o03vWCsXHXJlG8qA2K2QzYQVARQmxRiD4lpvmZRRyh38y4tumhMwbFtvEzGXuBW6pb ldgsQwh6f67hVU5UbwiFIA9h9ukWd3s4EvXJN/63eGltsAL52ERcwXrqbLbGVrbHmIXq JiqkNcbGzKeNQjQ2wlyRw7FgB5PV56VSBfhjviGNp1dNHjaGmBpy4Fpo5HsTpTFaq3I9 lKJw== X-Gm-Message-State: AGRZ1gInmjHzT56GTVjLIKGwQl8KDBXm2nv8AsRy+ASRXbTEb5N3P7lE gkrBAoCSmXYv8GkirSBwqdfVHg== X-Google-Smtp-Source: AJdET5cLO7KYTyB7oCe/atnGxEnJUZ6W4Zog8y7eCTajPEDYHTsDO/7AC2cgPPCxZk6uSXu/A2yz9g== X-Received: by 2002:a63:7418:: with SMTP id p24mr16668600pgc.196.1542007596852; Sun, 11 Nov 2018 23:26:36 -0800 (PST) Received: from ubt.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id w2-v6sm18668331pfn.89.2018.11.11.23.26.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 11 Nov 2018 23:26:36 -0800 (PST) From: Chunyan Zhang To: Ulf Hansson , Adrian Hunter 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 v2 0/3] Add support for using external dma in SDHCI Date: Mon, 12 Nov 2018 15:26:03 +0800 Message-Id: <1542007566-9449-1-git-send-email-zhang.chunyan@linaro.org> X-Mailer: git-send-email 2.7.4 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 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 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 | 13 ++ drivers/mmc/host/sdhci-omap.c | 7 + drivers/mmc/host/sdhci.c | 181 ++++++++++++++++++++- drivers/mmc/host/sdhci.h | 8 + 5 files changed, 215 insertions(+), 1 deletion(-)