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: 150782 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2833161ljp; Sun, 11 Nov 2018 23:26:39 -0800 (PST) X-Google-Smtp-Source: AJdET5f1Sm+GPZy7lJRPVUm/Uc5DMEduEUMsG6sDDoWLhkgae7JdAzRGi0xdlyiux1/EI9ICg4JN X-Received: by 2002:a17:902:bccc:: with SMTP id o12-v6mr19209904pls.281.1542007599014; Sun, 11 Nov 2018 23:26:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542007599; cv=none; d=google.com; s=arc-20160816; b=UPTuBQgL12AP2wsJeSEZZZml1kdZlsAHo292hV3WxLvHSu5FL/tXFE+3sJnM1ikg0E LEN0ViMDFQf2VRrFnrp6eeRaOdIJyyglqez6/L57MgVOeRkluE8nqBNQKyuOEr8LrfpL YD/lX4hRqlxKZicsLSn778UtN2NFvfyWZ7916e0JqBOeBGl+94pFaYSJQfDh1RGk5Nxh MHpAiZWk+LLNrc+9lIiO6vVZcEEyOg/XpgdB0hZjoGCvIZnyPxJDjGjsUnSHxj4TPDvO iRZnJfyZ3mYA/HoaY8SwH5mr4/FORLahJH6QsLXLTW9oGI1sKMNXuag/abu0/AXI5YSg LgMw== 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=MaJ6kGoogNk7TlYPNyNVU1hBPKpkcHrSdo7gFd6mNXY=; b=ykKVuKYWe91SBJIszLfov94Bjk2F+0QQR0gf61cN2WziEFdWOhewBaUbwCT5XX9GVw y+IF8H6KCdBfv9x/fdImvJJXsF67OcFgHKCAZPj6lySIqrI06KZaVLoVO6MkwAolCTdt 7uv8pSdFvJ6Q9YcFXPRZICaJZXyOJueRTz2eQQ8j8bZ3/lPmYbXsJN4u/fZsp27MFWPf bf8tGHMFN1HSqrNbpF69X6l4dKhiuyloYAPB5ORK0AdUhiQ8CU8rPwKWnHR3QCFxd/ur SAIr/rg9mQ9YGUqCt7tHs8/PatBEgmFWJsfDsXhyKIKmYn/R4lolQMva/z/MlZdl13ol PtDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="i6FQS/oW"; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-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 b6si9859361pgg.2.2018.11.11.23.26.38; Sun, 11 Nov 2018 23:26:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-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="i6FQS/oW"; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-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 S1726971AbeKLRSf (ORCPT + 5 others); 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-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 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(-) -- 2.7.4