Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6785511imu; Mon, 3 Dec 2018 02:48:39 -0800 (PST) X-Google-Smtp-Source: AFSGD/XX7OEh0xfL7N3gibkjYrLYeJ8svk/TwqvyWizaKFiDhdcLin3zczAEbMYPKA2TNQcdjt5Q X-Received: by 2002:a17:902:b595:: with SMTP id a21mr14849031pls.120.1543834119559; Mon, 03 Dec 2018 02:48:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543834119; cv=none; d=google.com; s=arc-20160816; b=zGUMIUbb3Yhfo48judFzBNSLABlAUh4xEatGpFx1jUQ3O8clGig+aRiuokImpLrN7y b8Q2yGuo7wHdfOyDay0xMMXwcXKXRn+Y/N3z9W3z61KpT5bSwBL7yUeGh9l3/92kc4qZ raapQJkrVExRGk0NUT/GSN/OZG8YT6Al+z6SseDD8pk8C4CokcJHuowyymmYoiIsaczt r9wfp46RLdT/nnBVPVQbCM0PtIlr7YOwtWhdz+LuoT0jFHMjTWdUTTM+j1SD5zOZCj7T e5M1HUCpngt7iwmQS4Y7F9Fhn95ED+eOY2RZf9hXyt4bkKLkCuxnTBbCAv/iWXAUJrU3 wn7g== 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=DwydGyffLoyVQbictEcQXUTSUtaLHUV7UHrtoEBRrEI=; b=ddMVAZ/b/4is4xzUI/R73YReyunPh5Z/k6E50chV7Xi0ltTdOAlj5aEOegGmHqAcGJ +QC4peXoIP1kAi68x6MEM/Rxw5bubrTi9f3pbf4gEStCPzhwrS2TdO4NyocM+oK3lBci /tfuICn8P4sCGADZqbvaEyUwJBanhmD8zqdcYgY9YibOEDlbhlGbpjsvDkKxpwr/oIH7 teVVadYbrakPidhdRvt4pcSgDKuj4rYEDPg2jilxC8irB5plgu8BA9ZvlOO/jIBUFRIW k/YL56g/dLVILfAE0qwDI4GQNuA4kgA+HVr264uptEBM7tP60ax8A3WwRXH54TGoO6dq T1uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fK8NZ1Wt; 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 j11si14161390plb.253.2018.12.03.02.48.24; Mon, 03 Dec 2018 02:48:39 -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=fK8NZ1Wt; 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 S1726208AbeLCKsK (ORCPT + 99 others); Mon, 3 Dec 2018 05:48:10 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:37482 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726078AbeLCKsK (ORCPT ); Mon, 3 Dec 2018 05:48:10 -0500 Received: by mail-ed1-f65.google.com with SMTP id h15so10299333edb.4 for ; Mon, 03 Dec 2018 02:47:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DwydGyffLoyVQbictEcQXUTSUtaLHUV7UHrtoEBRrEI=; b=fK8NZ1WtWLW88JL09zjR0pKPEogEOy3qtfpXNs0mMt7sz5Qumpt3lic4u/bpySpa+L K37niMGhVQZTRW6SeZfZLtvOGh0PdYW/qW/S7FHgT7oeRs4aZidVHp4UYCx4NfgU3ohT XkHlw/50VRseWpQ8YP2Kyht61I9UYSdxhA3B8= 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=DwydGyffLoyVQbictEcQXUTSUtaLHUV7UHrtoEBRrEI=; b=qNFGUBnC25yT0fSEQTQzHp9BRRA8N4vGPGdkZoUANKx+B1Z7koqZPo1cZpV8LqDa0Y 18BzT47xhIvLLMDlvcFl7dLDY2WN8WoKIr+W87NKOdisyfJ++h4vfNkqVISmOpJyYiu9 EsvmEzdJ62Kkgq86iatJTaOjZOSxn/HDo+Hjpg63rqAbLN9dQg4ZnLrWs8TY0hvRLXAw 6EIYhRaJYy6ppknM6UbExxFbsTtsJcHHAoNNtT6XHAugGhQ8Te3rfASUxrShArwL9Xis 3uBsHdNDdBePZQePyNQBGhkkVv3mXemKIWCJE02AMPU8j0+IO9IO/Z/1I3npAOfH1Umo Tm4g== X-Gm-Message-State: AA+aEWbLnXLf/+lzMYqoRTHsGNJobObNd5AAdzEnd2UjSFAJI4NvG5LI rgchFUgUclYUCqQw7VWftWsrH/rFp7gL5GrFthqLjXtLqJs= X-Received: by 2002:a50:a7c4:: with SMTP id i62mr14257122edc.162.1543834058764; Mon, 03 Dec 2018 02:47:38 -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> <22591bc4-ea34-dcc6-a3d5-8a75e890ff2b@rock-chips.com> In-Reply-To: <22591bc4-ea34-dcc6-a3d5-8a75e890ff2b@rock-chips.com> From: Chunyan Zhang Date: Mon, 3 Dec 2018 18:47:27 +0800 Message-ID: Subject: Re: [PATCH v2 1/3] mmc: sdhci: add support for using external DMA devices To: Shawn Lin Cc: Lyra Zhang , Adrian Hunter , Ulf Hansson , linux-mmc@vger.kernel.org, Linux Kernel Mailing List , Arnd Bergmann , Mark Brown , Kishon Vijay Abraham I , Sekhar Nori 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 On Fri, 30 Nov 2018 at 09:15, Shawn Lin wrote: > > On 2018/11/29 17:59, Chunyan Zhang wrote: > > 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(). > > > > No, dmaengine_terminate_all is deprecated for quite a long time. > Please use dmaengine_terminate_{async, sync}() instead. > > See Documentation/dmaengine/client.txt Ok, thanks for the comments. Chunyan > > > > 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 > > > > >