Received: by 10.192.165.156 with SMTP id m28csp1846444imm; Thu, 12 Apr 2018 04:40:18 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+Y01j4CQnM8mc2eV7iDpdzaLPqWrZwkusFk79O4heKT8SaMs0k/ennS6fR8isDDvwk0mig X-Received: by 2002:a17:902:6709:: with SMTP id f9-v6mr641016plk.159.1523533218622; Thu, 12 Apr 2018 04:40:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523533218; cv=none; d=google.com; s=arc-20160816; b=psVcN+ePwVtwVrxkrVkmLV/Ykl4TB+6KRyl99mBuZb4xvmZnKx6OZo0eRSgcwxCEH2 9giPTtGmfPwxXgX7F8hNnMmSvNc7dlLGWqgZcZP6Ip1+GYbmwZWj6upRZeenUyZHqn8l QTThrpjUPZVYdjzD3cbq/1sHzDhhLM42DSyqd5f4aOdAY3uFY0c7qGWEpnPk2qzK/17y nUWKmarYy2k6I1sAKB+gnlasFGBqB5UGheY9SQoPoyuXN8VeRJeLv0h3E1yslk43e5hm VVR7eHCPmoslwc904RZpHtSvr8aUTMnZ4HUK0HBaJ6MfxCFp3QB9f+iblHPM9qCO/+XA idXw== 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=VOnNI96TjTFp/9qNst61hw592j6bWcZ38VVh9uQLMPM=; b=Etzi46tzanT9NGruc1hzXblcsgCU7XB6xaMn0SByY6radEiTJDN+yEZOe3a3Y5+az1 cT6MkuKk6PuHylxHupeF44yE2J0uZVtFrXcdrg/ihWF+Q+1xSOP+vqpom3V2SeWcJ+JL fXtv9xpLwGuwYH3eCA9d2YJKhF+XJ/u9cw8YwIZUPsfGgpbFFslfaWTbYJCdxdZ+W0O1 O+RWbzQxDLiPNHVbnlAQJryHxWHqGLvX7b5Tz9OVnl6J/BiS1RyjRJEkzaQrb66LAVcb WNRuMnkvoRExEvGwt2BSI8cV5B6MWOfAsb9hN8UpxBg4SQ4vr+E8llk8mTpn4+y6fu+6 i39A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KNksJN4K; 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 i13si2090683pgs.638.2018.04.12.04.39.41; Thu, 12 Apr 2018 04:40:18 -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=KNksJN4K; 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 S1752657AbeDLLgh (ORCPT + 99 others); Thu, 12 Apr 2018 07:36:37 -0400 Received: from mail-oi0-f41.google.com ([209.85.218.41]:43123 "EHLO mail-oi0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751918AbeDLLgf (ORCPT ); Thu, 12 Apr 2018 07:36:35 -0400 Received: by mail-oi0-f41.google.com with SMTP id u84-v6so4796374oie.10 for ; Thu, 12 Apr 2018 04:36:35 -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=VOnNI96TjTFp/9qNst61hw592j6bWcZ38VVh9uQLMPM=; b=KNksJN4K/Zb7Hk3siHwEBdHPIFAFodYehxBb8rYe0KWcgjhh9F32HL2bCGXYSn6nUN 7V/HEZtmw+QgymTThWs28AYhDP3uE/UqY/tjn+Q9WyQa8NQqUw0FmdVmQ9JkhY+ushvj +NHq6kTzyWj4+OqAoKlDa6zl98wr8izCPbeVQ= 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=VOnNI96TjTFp/9qNst61hw592j6bWcZ38VVh9uQLMPM=; b=Ttm9DXhllHe3tNiwirgDZFGTQaCg1LPTOAa+dQREmCxp9vdX03H6MgMWuT6rDYX3w2 zT5N/m1VPRuhTURA8dfccNv8PetZExMGEWNx7lsatg3Wq1AZjH60VrThnbPgwErR+2o3 vJH+bRDvTuJqRpc+YGKIkPz1ZqgHZgNh4rrh2RyepAaBrtbMjSRsZYpXfaso9IBefREC VHl/WYXRxfmevSlLP6+Ic5fjjWn9gzyGbTGXEOMk0w1UhPOBr0Bl5SEYt77aepop4SCo BcO5Mz3tUntIULuhz6XN4wjN/vrr1d+TVT5wl+PnQNip552V9I3lh4thxgqRw0YKkEE5 jTWA== X-Gm-Message-State: ALQs6tBTC+mwY9v95007bP8MZ2wBkbtN+RkSJNDca2PrdN9qjDfzZ/BW 0azlLpIuV9Y39P9NIduujBR2NelLBPdS7fKawkPxVw== X-Received: by 2002:aca:acd1:: with SMTP id v200-v6mr5608744oie.320.1523532994610; Thu, 12 Apr 2018 04:36:34 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:7081:0:0:0:0:0 with HTTP; Thu, 12 Apr 2018 04:36:34 -0700 (PDT) In-Reply-To: References: <0c2b76aba6a49e583f920ae582d6815fa9cc4361.1523346135.git.baolin.wang@linaro.org> <20180411093634.GC6014@localhost> <20180412093735.GF6014@localhost> From: Baolin Wang Date: Thu, 12 Apr 2018 19:36:34 +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 On 12 April 2018 at 19:30, Baolin Wang wrote: > 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. After more thinking, I think this will be not useful for users, since users need configure one DMA channel through different 3 places, specify the request mode in dts, specify the interrupt type through prep call flags, and other configuration need to be configured through 'struct sprd_dma_config'. That is not one good design for users. What do you think? Thanks. -- Baolin.wang Best Regards