Received: by 10.192.165.156 with SMTP id m28csp1840248imm; Thu, 12 Apr 2018 04:33:36 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/FOvF/d5p2kd0DUeOvcxY/5dxs3/o0J5tIksWgh82NlcpY/aqPrZI4BrPaRy1VzIsftJ6Q X-Received: by 2002:a17:902:9305:: with SMTP id bc5-v6mr633590plb.18.1523532816562; Thu, 12 Apr 2018 04:33:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523532816; cv=none; d=google.com; s=arc-20160816; b=IIsA4+5INhKIRgDX//6Yx2IP6B078tgHxrp2qZwVdUMMRGaBHFfhTUfs+S7Mggx3qc xUfmVChDSjNYQpx2YjHfX8Xv62sekkomRX/DPcZURv5Bk/Cwm//sR1MjJcsK1ChYkiXc /Da+5aNmOrTnDJTKgPP9Q1Jamqz/9dmIyL1yWC+qYnHgg+m2s4zQXS4tlAGiziKyEIOs qFcccDKKej9chq/o/EO3j19FOZLeAqltDmweOYWIBJBSwiyE0XFIQXURWbQDHpopJqI4 yWWD5w3IHZqcRqtV51OSUWFS3vylgnSUGsAKnusZU1diwchPW0tyAPQP9RPjMlCsTGOx eFyA== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=VdAITPT4EGREE33QtcYE5FdjTYuU00YuyZgEJa+BKrI=; b=LCXNYLkY/k9MYFT6yUvP5CJgePlYc8TKBII10JcrKahxsKsIQUjyzIaHJgGkX+kJBk 7Cx5+CeqI9zaEU3J8KwCkHSOhahLUakRmen9BwBq7rk/xT6pmSdmxK+2zcqie4/KZ9S2 r8Gnc8zJR3P5JXvhSeYv3HZJrsKOF+CSrmgwyfa0Eay455GQHnIaQm2/M6oMzeb+XEU4 kMyHkkWTfIGEPoPD/nZCJMOtrbvj2Kp96B1t1+UaV3srD5Pv5f8lJAcZB9zvxNn9V8+Y dyaIYP8F2LSeZdrbtYWEmQPew7vx4ktjk8kGnaAYNppeJMtSA/3zGRh75Ws5Ltb4hFmA dIPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M7n2c2at; 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 ba2-v6si3196258plb.110.2018.04.12.04.32.59; Thu, 12 Apr 2018 04:33:36 -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=@linaro.org header.s=google header.b=M7n2c2at; 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 S1752320AbeDLLaD (ORCPT + 99 others); Thu, 12 Apr 2018 07:30:03 -0400 Received: from mail-oi0-f48.google.com ([209.85.218.48]:44143 "EHLO mail-oi0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750763AbeDLLaC (ORCPT ); Thu, 12 Apr 2018 07:30:02 -0400 Received: by mail-oi0-f48.google.com with SMTP id j143-v6so4771328oih.11 for ; Thu, 12 Apr 2018 04:30:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=VdAITPT4EGREE33QtcYE5FdjTYuU00YuyZgEJa+BKrI=; b=M7n2c2atD1cnpgWv0UzcMUEP/3tzMpMHwfAykfRtRQjwFI0LSi8N6QihCkuAuAHK32 uObL3SaZ7hLAwSqVKd2LHNs+HUq0xd/OZFfqOJGrrEhh7RiGClTLTEDDErAXp3xor5t9 7OK/fktDt/XwCSPnSRD2DsoMiZaiOCHqXe4oc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=VdAITPT4EGREE33QtcYE5FdjTYuU00YuyZgEJa+BKrI=; b=WauXwN9WjXv7/4pSGAVl2ZCBCcATsN3JL5YvyRfOov1TABVunjbnyO4I8abvR6bLY0 TbGssGV+WEZ1pCntvzv6Rj8WOofFoNoTOS4jfcndKoWsJaEOzJDZZDbZCwdtgxmka43u DECjyAkZLJVf77r8dfyiCdNV4/w6a4LCS+9CuP2h2ncEuttyP+GJtKl2weKqxxnfk+d9 lkdQD97hQIzCykr+GombPtY4T/h4b5CGsoXIxHf4jehV5vgWDo8FpkJfKeagh32AXOU3 kYWtKgoDv1jT2m2yMI/H77UN1LYJuIf+C2ums0n2FjVOdOc4EJ3XTbKfjZLWWPNoOdfS 8tjA== X-Gm-Message-State: ALQs6tB8RAk38FRrEKJM7OeA28y+8cl8yDcOldYohRQ1WIysg2sVu0z5 qpWIcVKUzquVq3bwua6bSBlC5MzbQdCSk+ooccmnlA== X-Received: by 2002:aca:f513:: with SMTP id t19-v6mr5714444oih.128.1523532601547; Thu, 12 Apr 2018 04:30:01 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:7081:0:0:0:0:0 with HTTP; Thu, 12 Apr 2018 04:30:01 -0700 (PDT) In-Reply-To: <20180412093735.GF6014@localhost> References: <0c2b76aba6a49e583f920ae582d6815fa9cc4361.1523346135.git.baolin.wang@linaro.org> <20180411093634.GC6014@localhost> <20180412093735.GF6014@localhost> From: Baolin Wang Date: Thu, 12 Apr 2018 19:30:01 +0800 Message-ID: Subject: Re: [PATCH 4/5] dmaengine: sprd: Add Spreadtrum DMA configuration To: Vinod Koul Cc: Dan Williams , Eric Long , Mark Brown , dmaengine@vger.kernel.org, LKML 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 Vinod, On 12 April 2018 at 17:37, Vinod Koul wrote: > On Wed, Apr 11, 2018 at 08:13:28PM +0800, Baolin Wang wrote: >> Hi Vinod, >> >> On 11 April 2018 at 17:36, Vinod Koul wrote: >> > On Tue, Apr 10, 2018 at 03:46:06PM +0800, Baolin Wang wrote: >> > >> >> +/* >> >> + * struct sprd_dma_config - DMA configuration structure >> >> + * @config: dma slave channel config >> >> + * @fragment_len: specify one fragment transfer length >> >> + * @block_len: specify one block transfer length >> >> + * @transcation_len: specify one transcation transfer length >> >> + * @wrap_ptr: wrap pointer address, once the transfer address reaches the >> >> + * 'wrap_ptr', the next transfer address will jump to the 'wrap_to' address. >> >> + * @wrap_to: wrap jump to address >> >> + * @req_mode: specify the DMA request mode >> >> + * @int_mode: specify the DMA interrupt type >> >> + */ >> >> +struct sprd_dma_config { >> >> + struct dma_slave_config config; >> >> + u32 fragment_len; >> > >> > why not use _maxburst? >> >> Yes, I can use maxburst. >> >> > >> >> + u32 block_len; >> >> + u32 transcation_len; >> > >> > what does block and transaction len refer to here >> >> Our DMA has 3 transfer mode: transaction transfer, block transfer and >> fragment transfer. One transaction transfer can contain several blocks >> transfer, and each block can be set proper block step. One block can >> contain several fragments transfer with proper fragment step. It can >> generate interrupts when one transaction transfer or block transfer or >> fragment transfer is completed if user set the interrupt type. So here >> we should set the length for transaction transfer, block transfer and >> fragment transfer. > > what are the max size these types support? These types max size definition: #define SPRD_DMA_FRG_LEN_MASK GENMASK(16, 0) #define SPRD_DMA_BLK_LEN_MASK GENMASK(16, 0) #define SPRD_DMA_TRSC_LEN_MASK GENMASK(27, 0) >> >> > >> >> + phys_addr_t wrap_ptr; >> >> + phys_addr_t wrap_to; >> > >> > this sound sg_list to me, why are we not using that here >> >> It is similar to sg list, but it is not one software action, we have >> hardware registers to help to jump one specified address. >> >> > >> >> + enum sprd_dma_req_mode req_mode; >> > >> > Looking at definition of request mode we have frag, block, transaction list >> > etc.. That should depend upon dma request. If you have been asked to >> > transfer a list, you shall configure list mode. if it is a single >> > transaction then it should be transaction mode! >> >> If I understand your points correctly, you mean we can specify the >> request mode when requesting one slave channel by >> 'dma_request_slave_channel()'. But we need change the request mode >> dynamically following different transfer task for this channel, so I >> am afraid we can not specify the request mode of this channel at >> requesting time. > > Nope a channel has nothing to do with request type. You request and grab a > channel. Then you prepare a descriptor for a dma transaction. Based on > transaction requested you should intelligently break it down and create a > descriptor which uses transaction/block/fragment so that DMA throughput is > efficient. If prepare has sg list then you should use link list mode. > Further if you support max length, say 16KB and request is for 20KB you may > break it down for link list with two segments. OK. So I can add one more cell to specify the request mode for this channel. dmas = <&apdma 11 SPRD_DMA_BLK_REQ> > > Each prep call has flags associated, that can help you configure interrupt > behaviour. Sounds reasonable. Thanks for your comments. -- Baolin.wang Best Regards