Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2258323imu; Thu, 29 Nov 2018 02:01:30 -0800 (PST) X-Google-Smtp-Source: AFSGD/VY6iyCacUCZ6XmC8i8YK719p2l53ml52w81QVzW6ttYjMrOo9Eoy4Ec0kihOAD4HUfssjB X-Received: by 2002:a62:ab0d:: with SMTP id p13mr736448pff.211.1543485690236; Thu, 29 Nov 2018 02:01:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543485690; cv=none; d=google.com; s=arc-20160816; b=DIprguOOG8kqSangZRPRCgVgybrENT/prWULbRUOnVGEaLIcGscNsFGIfHPr5hbM61 LZmcZLuDHnd+MIbd8slqDcsPH0v0rVjSw/GHekVNgSUlLBot3D65/qQ2tVF2p0a8KpmD 6OdCDUdLPtjs6jRWxqwzkYFcjg3dvZI+pFUq7QfxQS5GNP+gjUEDpPuQ+hZbhSG3xl8k XS+rPZCwAtFc6gUDCdUw5Zq6AI24Oy84RipzfSRDH6Slu5Ev0G5qY2I8Vz/09+7SPXmU A+o4McbeamRoRf9Rkmned/TH/PWTrEqOBKuY2p+YsrlHoSuamirEDc677+ZgdPRrtoMm DVCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=qA1DNuw+7GiqVUBAahLlA+0uqyff0Brlhy+2UZlD/dI=; b=jbeVcFfVb1dVWbVerV5rp90BXeFl/fi+ENo2bYCTlpfwn59W5ZS754KW4Hd5Du1+Ka +ImxXYGtsnW1jSxlXcL38m97Yrxzia1ALUJwyVtb5rmgFqBeqWrj4Z/T6lWShWaCJLrL 98Qv7YxglToK/MNC0KvjETFjw+Am26CQSPjNfHns93hLgZlZ/pI15K/Zyzx23rGBFFIR YlSV42P6oXMqb9XSuJgJep168tSp99dkO9NpO+pSsPequwkOkF3WdlCAYwdnoPSL+qh3 anIxe33X0p9w7xSI4+PPIgU39LtEmQwsbgid4Nn4e+PnjhQFmrLREgLoz4UPEHrqRoAW CsGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="SLsAmmd/"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k38si1497802pgi.235.2018.11.29.02.01.14; Thu, 29 Nov 2018 02:01:30 -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=@gmail.com header.s=20161025 header.b="SLsAmmd/"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726949AbeK2VFM (ORCPT + 99 others); Thu, 29 Nov 2018 16:05:12 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:41822 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726621AbeK2VFM (ORCPT ); Thu, 29 Nov 2018 16:05:12 -0500 Received: by mail-lf1-f67.google.com with SMTP id c16so962822lfj.8; Thu, 29 Nov 2018 02:00:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qA1DNuw+7GiqVUBAahLlA+0uqyff0Brlhy+2UZlD/dI=; b=SLsAmmd/zyPgskuVNZESLCfDNFRyNP7fwMGHhMdA8qe4qBfE1rvCxWmCPAhhHuzhf1 XyyUQN6lGLg2g+BdjeAj5AZvKREtbMYJlemqmz+McRMYlnHqm6ZBJ86yc5e15gDmIaY/ HZmhk9QqCPmp/w2056tXZZI5CztUA66cCRbLeFROjaKpJwDS9rP6b+EUVVItWnVKVua5 QKoqWEVhA0Km0k11fll9bTcrw5zGz5aJVCJfDYMRelp1M/NRHV9kKX+irEY730BbiEg8 lWzU3DOjsMA+8L9TLh3OTHfTsuJod9SjRJai6QZsz2IU4n+WQjf+yFLuFdaFtB2mdkMz g4Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qA1DNuw+7GiqVUBAahLlA+0uqyff0Brlhy+2UZlD/dI=; b=SMLwTrIphawQGZGWBMMv7BOa/IDsrKqoCkIslLtlWgRR+3FLby5gUA5zhKmfakIsRv 6aeBXAsrKkIMBMyxsSs9nI6kMzWS6XXQf2LPHezjriE0RULOZ/kDrxRU79zqa6XZzcfS oLugbS1J7o9blDhICqUmEhMAUk45VuUOQ1fBJbLca4rtqVdUvIlgU8bXe92Wkxs9BASv KEPMCfMW0XYzh2Ux1F29NOZABTnOWjQUbJQmYYh4Bc5no/Q/aWH6x6v4MuQKboQ02Gf3 hvgatveS8r9WxrM9Z8inSM6kcCeNgHydu7XzJyNx7H7ofOcigULP2+E7/9HvLb1AT7bF 4Xrg== X-Gm-Message-State: AA+aEWa9OskPqX7GvBJV6syYvqQlAXw6CFma6DhIlxuiiGCImtwNflky U4tUspr5vEABTQgx6n5gbDv62ow03bQSBhWyW9A= X-Received: by 2002:a19:d58e:: with SMTP id m136mr638831lfg.70.1543485623040; Thu, 29 Nov 2018 02:00:23 -0800 (PST) MIME-Version: 1.0 References: <1542007566-9449-1-git-send-email-zhang.chunyan@linaro.org> <1542007566-9449-2-git-send-email-zhang.chunyan@linaro.org> <84836600-c705-9ac3-297e-bb67a611daca@intel.com> In-Reply-To: From: Chunyan Zhang Date: Thu, 29 Nov 2018 17:59:46 +0800 Message-ID: Subject: Re: [PATCH v2 1/3] mmc: sdhci: add support for using external DMA devices To: Adrian Hunter Cc: Chunyan Zhang , Ulf Hansson , linux-mmc@vger.kernel.org, Linux Kernel Mailing List , Arnd Bergmann , Mark Brown , kishon@ti.com, nsekhar@ti.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Adrian, On Thu, 29 Nov 2018 at 15:36, Adrian Hunter wrote: > > On 29/11/18 8:22 AM, Chunyan Zhang wrote: > > On Tue, 20 Nov 2018 at 21:41, Adrian Hunter wrote: > >> > >> On 12/11/18 9:26 AM, Chunyan Zhang wrote: > >>> Some standard SD host controllers can support both external dma > >>> controllers as well as ADMA/SDMA in which the SD host controller > >>> acts as DMA master. TI's omap controller is the case as an example. > >>> > >>> Currently the generic SDHCI code supports ADMA/SDMA integrated in > >>> 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 an external DMA controller with SDHCI. > >> > >> I still think you probably need to reset the DMA if there are transfer > >> errors - perhaps you could comment on that. Also there are some comments below. > > > > With regard to "transfer error", do you mean if > > sdhci_external_dma_setup() failed? > > No, I mean any error interrupt that can leave the DMA uncompleted. For > SDHCI, resetting the data circuit cleans that up, but presumably something > is needed for external DMA? Yes, it should need a dmaengine_terminate_all(). How about adding that at here (I will wrap it up of course): https://elixir.bootlin.com/linux/v4.19.5/source/drivers/mmc/host/sdhci.c#L2553 Is there somewhere else I'm missing? Thanks, Chunyan