Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp697280imm; Fri, 11 May 2018 05:06:42 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqvINFMA+EtbkkC5KFsS9gb6dZgcGmxVZ29PZO6UjbNVLs25NUNW13McupcvkbJQVn6sbWd X-Received: by 2002:a17:902:5327:: with SMTP id b36-v6mr5413617pli.316.1526040402460; Fri, 11 May 2018 05:06:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526040402; cv=none; d=google.com; s=arc-20160816; b=KWuX3LwDDXMdUXA4TAKNPRDbOLsodyKtwulHRD62JpU5k74DEBIUiAYqyNlCqNlPg1 Bw0l0JPC3lolRg0w1Q0kT0REHE2DGn1DAxNDlI28HeVwra3c9syoXNSN0EOwrLvu95MH TOt6zuzUbNxqhI2c/bjquWXUMw2SAZCSjwif1vfYwDixiCdSWD2J8jS/wGKdkODSY7dw 9sdp8C/ltYFCNkunDWAgjKenVSazNa6VWZl1IAWeWJdxAsedJBqSzvpi2p1TsdXu//rM Rak8LkNNETWG4mKjKqRNflUQkhE39FQNJAr/xEnPOzH6rpugiuNevDkC6u503pctLkFc gXig== 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:arc-authentication-results; bh=zvlhduRhZVZnlzR5JyFGCz5IAvJfkZVvWJEkFReEtbk=; b=q06EZQnF0Kp7Vgzcn/yT3I93XC4IRDWGubiVhl5jgTN1kCELb/UmDhxgau9mT6uQIJ jp10cUYPsWVqt1QK9AIATMxmB+LVy8ZGx5+AM12WRq4BIahSiLVWnSRK3TP8iQltgXJ6 JZMpffpAFzQUcyOnHio1LB/RrODfySP2QWCxsoseZ85ZwltFaWK98brIexMlipRmGraG 2+bwci20/lRG+xPPhmfpo5o9nZOZomx0TKwtpYAAoEyY15svNX71Ih2DnEBzR24zF20U frS3BjSrEU06iZIOF04jABWdraFGFfWizYi/aABtrBuUPmS0vfhjBi9eUO577OHjBMCr 0Sig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hrgVWgmf; 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 64-v6si2920799ply.528.2018.05.11.05.06.25; Fri, 11 May 2018 05:06:42 -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=hrgVWgmf; 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 S1752604AbeEKMFD (ORCPT + 99 others); Fri, 11 May 2018 08:05:03 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:38899 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751000AbeEKMFA (ORCPT ); Fri, 11 May 2018 08:05:00 -0400 Received: by mail-pl0-f68.google.com with SMTP id c11-v6so3199791plr.5 for ; Fri, 11 May 2018 05:05:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=zvlhduRhZVZnlzR5JyFGCz5IAvJfkZVvWJEkFReEtbk=; b=hrgVWgmfYi1+mk589kawTy58qSwztB4q50uSl9ENCFM3UyrnZVa7c/arKM7RjQY8w/ oHlo7sG5QjZDiWZfoxOzX6qVKIF0obGguwe+4CXuEOJ/PIAAZ7vp50xUdqzt+BtZd1Tr K6nqfoONLKIePSnqaTcRonvVCfoCQ41VYbaa8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=zvlhduRhZVZnlzR5JyFGCz5IAvJfkZVvWJEkFReEtbk=; b=Hz1Ego2Sa0NlK3n7KYFvW76dOZkZk1V29MQl6cNTz5RGrt2mbRiXXqOOfRx4x1WKZ/ 0a+iVUj1lqNiL3bo3vDEoe5m8yJ6J7M1sAvZ1Y+B9LRTK4XZAkEHWJ1qb4U6nhey0T81 JfXScwL3EmLQIKfozKAO9ISzVE1ZdjhBIUppvpK+IU+5u6Sv9oAWiycqAPphdneec9r0 Jmz3Vtk0erttKeS7FnDmOh1XP6X9FZUMDYvtwLsdeSzNLClAwNafAQCpYb+5bwptTiMg UzuhOYfyut000BBnAx409YwM8GvUgK/xkNYD1rBQK8dJ9G62Tb44RRL0z9SShiN2DfCt PqRA== X-Gm-Message-State: ALKqPwcUfUFJS+Cw4PJXANmYg/xzb/95U0IWNDE5uVnnzbBs0HYM5EJa Yk4asWboBYOr+qNLnNcfLTHLQQ== X-Received: by 2002:a17:902:8541:: with SMTP id d1-v6mr5480303plo.106.1526040300352; Fri, 11 May 2018 05:05:00 -0700 (PDT) Received: from localhost ([106.201.104.21]) by smtp.gmail.com with ESMTPSA id v1-v6sm8265715pfd.2.2018.05.11.05.04.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 May 2018 05:04:59 -0700 (PDT) Date: Fri, 11 May 2018 17:34:57 +0530 From: Vinod Koul To: Baolin Wang Cc: Vinod Koul , Dan Williams , Eric Long , Mark Brown , Lars-Peter Clausen , dmaengine@vger.kernel.org, LKML Subject: Re: [PATCH v2 2/2] dmaengine: sprd: Add Spreadtrum DMA configuration Message-ID: <20180511120457.GD30118@vkoul-mobl> References: <67447aabb8e4e051ff39b814a0e169e6a91bb66e.1525863923.git.baolin.wang@linaro.org> <20180511112225.GA30118@vkoul-mobl> <20180511115306.GC30118@vkoul-mobl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 11-05-18, 19:58, Baolin Wang wrote: > On 11 May 2018 at 19:53, Vinod Koul wrote: > >> > > >> >> +/* > >> >> + * struct sprd_dma_config - DMA configuration structure > >> >> + * @cfg: dma slave channel runtime config > >> >> + * @src_addr: the source physical address > >> >> + * @dst_addr: the destination physical address > >> >> + * @block_len: specify one block transfer length > >> >> + * @transcation_len: specify one transcation transfer length > >> >> + * @src_step: source transfer step > >> >> + * @dst_step: destination transfer step > >> >> + * @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 cfg; > >> >> + phys_addr_t src_addr; > >> >> + phys_addr_t dst_addr; > >> > > >> > these are already in cfg so why duplicate, same for few more here. > >> > >> We save them in 'struct sprd_dma_config' as one parameter for > >> sprd_dma_config(), otherwise we need add 2 more parameters (src and > >> dst) for sprd_dma_config(). > > > > I am not sure I follow... > > > > I meant you can use sprd_dma_config.cfg->src_addr/dst_addr and remove src_addr & > > dst_addr in the sprd_dma_config. It duplicate.. > > But we can not set values if dir == DMA_MEM_TO_DEV, since they > represent the device address, right? > sprd_dma_config.cfg->src_addr = sg_dma_address(sg); Ah right and that is another issue to fix then :) we should not store addresses you get for prep_ calls. They are supposed to be stored in the descriptor. Current approach is not correct. You can get different prepare calls (i think fixing this will remove 1 sg limitation).. and use the argument values and store in respective descriptors. Pls do see the other driver examples.. -- ~Vinod