Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp713069imm; Fri, 11 May 2018 05:20:55 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoDgVFTOmIa5tv2gJ8UO7AEPgWc9JsAubN6CBOZrSGw8W2KNlPv3qevVcT8Mto8GjZ8n4e6 X-Received: by 2002:a17:902:3343:: with SMTP id a61-v6mr5259406plc.241.1526041255538; Fri, 11 May 2018 05:20:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526041255; cv=none; d=google.com; s=arc-20160816; b=j/XReijfuOg+iXAxdaEWIb9r7/Izv6GyH5DvSYVguzSock3a0BRpzAd1hSDr+rnTB/ x6uCpzBqAAZFsvQ+9Kad7av3dpGb58kkKgWXXO+Y9uLQUndeA4MJMspIxxBRBwR87i39 9KZCO3FJuPi/4NnkOi41HV+aXgJXyiQ6gsbVGtRgfXIvyQfMXrB4z7JyG6NIh94+RnNM 6Ws6EUXsDoTHCJ6NEBZvMqKojo2giMKzNH3/9rYYFrdSvqdLXW3/zpRgKDExL2FnvRVa dhnPpRH9NO1zyX5DwINaVDLRmi9OyLM+YyElacKmeuof7BenDm5Ma4HUzhCo1Z/cD96Z zTJg== 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=5Tsx5xr2Ign7NODEqoJq5hk5Lv02QYpDN5GR1tPVzxI=; b=RiVcBUQW6LtlGDa835OK6U+Q3Qm0b185588aePjHvb9hwSITsdH1l5svXE2Q/DDFsC 7OAqcA9N8MiiLFe7diUI2juJZxdZLrYzOG+d80S/3s7vOM4iUSnAylyT+L/9vvwA+b0n UroHHINlgMveykSs63BBMiTX9Qw8YjefZt2tEF4vxbpLtQaxWDb/JyFHqSpG6SFU0V6q dvB5grAQRQ6ifA1mEM6c51uog4jnHJN4fNCqk0XzEr+esIAdK8gLYXoHlcfV8tM1hSgF Pv9IOLA77XXf/HtIuJobK1SRq3TipfEj9ougFXQfKZkypER861J4UncLSXJ+eQIxoq9v LMqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A/YaO7qh; 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 c10-v6si3064555pla.127.2018.05.11.05.20.38; Fri, 11 May 2018 05:20:55 -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=A/YaO7qh; 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 S1752272AbeEKMU0 (ORCPT + 99 others); Fri, 11 May 2018 08:20:26 -0400 Received: from mail-oi0-f54.google.com ([209.85.218.54]:33254 "EHLO mail-oi0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750726AbeEKMUZ (ORCPT ); Fri, 11 May 2018 08:20:25 -0400 Received: by mail-oi0-f54.google.com with SMTP id k5-v6so4550674oiw.0 for ; Fri, 11 May 2018 05:20:25 -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=5Tsx5xr2Ign7NODEqoJq5hk5Lv02QYpDN5GR1tPVzxI=; b=A/YaO7qh+keQn1JXKlZDg+HJK2aS8L2OZbNOQhuWMRyCs1bnd5e2ox0QfZzNYja+HP EYg9A1KujcNoKi5pUFewybyfAoCOWPIYHSgY1E9M1eZvHUV3wOdite9SKXCS6Ng/rN9k GOQn4l0dHoltSjebQoF8EbhyZ00dqnitf9Szw= 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=5Tsx5xr2Ign7NODEqoJq5hk5Lv02QYpDN5GR1tPVzxI=; b=MWqvtOCImXg35Gt/BPPPgCFrq8G7X15DKgyS68jvRfr7TlJdjiXf25pfwHFX8wA3H9 kBH/n87TUA+rAda17alQq+bd7HE740DsBHuHKIE1qSGtMcQB52R7VUzR6hF3JlzGbr7O Qj3pOwNgixdO/okXlk2Z5oK7wlPGFRRoha8QDngFGNmdq6hhZs1KAtT1Oh1NijMAgsWX iOtm5bpy35L3VoGHFnscjunjUsytN+gry73a9enKjMV+ZOb7uMxJZkvYAtGTQBBxgBnj gzeOEwmA5CEvXO/uUlk51lCyGMNyHXP0KORzNEc2GlhMuEZFtXwr6WlLJGdXVMPkKELY uz3w== X-Gm-Message-State: ALKqPweHvLER18eJMWpDhC2iYUHyFSuxs0726dRXYPEryczOzVAPWeOf tL67GWt3YUFNYiDgUvx7J58VH4ssnmD5lTjFRYnK6A== X-Received: by 2002:aca:4d4b:: with SMTP id a72-v6mr2874195oib.177.1526041224553; Fri, 11 May 2018 05:20:24 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:2d77:0:0:0:0:0 with HTTP; Fri, 11 May 2018 05:20:24 -0700 (PDT) In-Reply-To: <20180511120457.GD30118@vkoul-mobl> References: <67447aabb8e4e051ff39b814a0e169e6a91bb66e.1525863923.git.baolin.wang@linaro.org> <20180511112225.GA30118@vkoul-mobl> <20180511115306.GC30118@vkoul-mobl> <20180511120457.GD30118@vkoul-mobl> From: Baolin Wang Date: Fri, 11 May 2018 20:20:24 +0800 Message-ID: Subject: Re: [PATCH v2 2/2] dmaengine: sprd: Add Spreadtrum DMA configuration To: Vinod Koul Cc: Vinod Koul , Dan Williams , Eric Long , Mark Brown , Lars-Peter Clausen , 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 11 May 2018 at 20:04, Vinod Koul wrote: > 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. OK. But we do not want to touch the descriptor structure, so we plan to add 2 more parameters for sprd_dma_config(). And remove these 2 values from struct sprd_dma_config. > > 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 -- Baolin.wang Best Regards