Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5267981imm; Tue, 16 Oct 2018 07:45:40 -0700 (PDT) X-Google-Smtp-Source: ACcGV61AIHtjySJZNT6Cwm0rCfrBEbIHH8NYwUvi+41Fah1EFiE6qdgmHynv2NbVPEcINaEWvboG X-Received: by 2002:a17:902:b692:: with SMTP id c18-v6mr17168480pls.191.1539701140680; Tue, 16 Oct 2018 07:45:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539701140; cv=none; d=google.com; s=arc-20160816; b=avkWGhP4sLwptBsTDBI6i05E7UQUMjucRjXmYuq1tTqbRne6dRSQkT4HnsAMCcEjyD z35AaP3ugM8sEKJHMsGmsPdliYk2ysB2qSTo7CcYcESC0aFKaDGqec69bwb/BHWJYu+3 Z1ldrqlwun0vIf7036CKertqbR7EJ+NHSIrjwSy5DCDX/i+55O7BeY3bOU1CRESmXPIz RxutfLBbXu7kOh7z6Kjjl3bi4hLi0fmdi4Ghg7CZYgTutK8xYGnGi3s2b2w81Zy9g+Fa 3NFK2OvTIsIcrvirHYMY8H6TtjpPVLFRXAWHkxEwRXobgJ+xfw6OZeG79LxI5djQXYSU Fe4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wXTuPrUnra9f6bGMn6mgJx5bJbipDUYMQ8EmKI9G8bs=; b=aaPC6Uzod8icjMZ4QXA3gPtYlleHK1AZykIlGb+zh4AG0jyz4IQkB4bNb0bSpnvqfb AGm2YIziXqXDCZQ/kGCYKTycseU7I0eKJVyss6mTlJXASVkIjt4/CX+4Yvbg8ABCQscx 5s5Q4yU6HuYASd0WkJ93gzR0swI6PYecOwgiiwlqIUjKWTZeYWKunvzPrXYLI/HcleOC ucJOlQ74H9ntj0O+OOymlQrBHjnJxHkBOp1MPAZAHVwGqW9RVGMczTWIw2R8aNIX5R3A 9f97OiDf+MP4ah+MXNMDUMgqDJ54Xa8cYDkdIW203F9oskn2uNwssDcQOsLv7x5Km4WP obDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uFO55fqw; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o15-v6si14132218pgf.253.2018.10.16.07.45.23; Tue, 16 Oct 2018 07:45:40 -0700 (PDT) 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=@kernel.org header.s=default header.b=uFO55fqw; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727157AbeJPWf3 (ORCPT + 99 others); Tue, 16 Oct 2018 18:35:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:53890 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726778AbeJPWf2 (ORCPT ); Tue, 16 Oct 2018 18:35:28 -0400 Received: from localhost (unknown [106.201.39.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 001C420881; Tue, 16 Oct 2018 14:44:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539701080; bh=Sjz7AQg4FaRW/zW/lu2tkgAJUc8msJopx4zqoSr5M3o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uFO55fqwC0/IZrY09rEohld2CuNVu5IErt62Mv94PJYs++MN/GFo1bppa6kPcrgob ERGAuBC43HGix0378yWqubZAp2O1PCQ+ZpdzbESgLOGvlThC7oTSToXCfzEYclCcOw wQ870Cy10cARg7j9DGHrwBk4w1jlyaYM+4KpcwTw= Date: Tue, 16 Oct 2018 20:14:32 +0530 From: Vinod To: Pierre Yves MORDRET Cc: Rob Herring , Mark Rutland , Alexandre Torgue , Maxime Coquelin , Dan Williams , devicetree@vger.kernel.org, dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 4/7] dmaengine: stm32-dma: Add DMA/MDMA chaining support Message-ID: <20181016144432.GR2400@vkoul-mobl> References: <1538139715-24406-1-git-send-email-pierre-yves.mordret@st.com> <1538139715-24406-5-git-send-email-pierre-yves.mordret@st.com> <20181007160030.GB2372@vkoul-mobl> <20181010040343.GO2372@vkoul-mobl> <20181015171403.GM2400@vkoul-mobl> <9a375fd3-964f-3d57-9d18-b010e20a4d42@st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9a375fd3-964f-3d57-9d18-b010e20a4d42@st.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16-10-18, 11:19, Pierre Yves MORDRET wrote: > > > On 10/15/18 7:14 PM, Vinod wrote: > > On 10-10-18, 09:02, Pierre Yves MORDRET wrote: > >> > >> > >> On 10/10/2018 06:03 AM, Vinod wrote: > >>> On 09-10-18, 10:40, Pierre Yves MORDRET wrote: > >>>> > >>>> > >>>> On 10/07/2018 06:00 PM, Vinod wrote: > >>>>> On 28-09-18, 15:01, Pierre-Yves MORDRET wrote: > >>>>>> This patch adds support of DMA/MDMA chaining support. > >>>>>> It introduces an intermediate transfer between peripherals and STM32 DMA. > >>>>>> This intermediate transfer is triggered by SW for single M2D transfer and > >>>>>> by STM32 DMA IP for all other modes (sg, cyclic) and direction (D2M). > >>>>>> > >>>>>> A generic SRAM allocator is used for this intermediate buffer > >>>>>> Each DMA channel will be able to define its SRAM needs to achieve chaining > >>>>>> feature : (2 ^ order) * PAGE_SIZE. > >>>>>> For cyclic, SRAM buffer is derived from period length (rounded on > >>>>>> PAGE_SIZE). > >>>>> > >>>>> So IIUC, you chain two dma txns together and transfer data via an SRAM? > >>>> > >>>> Correct. one DMA is DMAv2 (stm32-dma) and the other is MDMA(stm32-mdma). > >>>> Intermediate transfer is between device and memory. > >>>> This intermediate transfer is using SDRAM. > >>> > >>> Ah so you use dma calls to setup mdma xtfers? I dont think that is a > >>> good idea. How do you know you should use mdma for subsequent transfer? > >>> > >> > >> When user bindings told to setup chaining intermediate MDMA transfers are always > >> triggers. > >> For instance if a user requests a Dev2Mem transfer with chaining. From client > >> pov this is still a prep_slave_sg. Internally DMAv2 is setup in cyclic mode (in > >> double buffer mode indeed => 2 buffer of PAGE_SIZE/2) and destination is SDRAM. > >> DMAv2 will flip/flop on those 2 buffers. > >> At the same time DMAv2 driver prepares a MDMA SG that will fetch data from those > >> 2 buffers in SDRAM and fills final destination memory. > > > > I am not able to follow is why does it need to be internal, why should > > the client not set the two transfers and trigger them? > > > > Client may use or not chaining: defined within DT. API and dynamic are same at That should be upto client... As a dmaengine driver you should enable data transfer from src to dstn. > driver client level. Moreover driver exposes only DMAv2 and not both DMAv2 and > MDMA. This is totally hidden for client. If client sets both this would imply Why should a controller be hidden from user, I dont see why that would be a good thing > changing all drivers that may want use chaining. Even more to deal with DMAv2 > and MDMA at its level. > Since DMAv2 deals with MDMA, all drivers are same as before. no changes required. It is not about changes, it is about the SW model you want to have. The intermediate SRAM transfers should not be made within DMAengine driver, client can chose to have two transfers and couple or not, it is upto them to choose. Sorry I do not like this abstraction and would like to see a cleaner approach -- ~Vinod