LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang@linaro.org>
To: Vinod Koul <vinod.koul@linaro.org>
Cc: Vinod Koul <vkoul@kernel.org>,
	Dan Williams <dan.j.williams@intel.com>,
	Eric Long <eric.long@spreadtrum.com>,
	Mark Brown <broonie@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	dmaengine@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 2/2] dmaengine: sprd: Add Spreadtrum DMA configuration
Date: Fri, 11 May 2018 20:20:24 +0800	[thread overview]
Message-ID: <CAMz4kuKP2+SGoAqQPkt2sFuh3DZiO=7tQ=KHrbPUwQBqn-Mkgw@mail.gmail.com> (raw)
In-Reply-To: <20180511120457.GD30118@vkoul-mobl>

On 11 May 2018 at 20:04, Vinod Koul <vinod.koul@linaro.org> wrote:
> On 11-05-18, 19:58, Baolin Wang wrote:
>> On 11 May 2018 at 19:53, Vinod Koul <vkoul@kernel.org> 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

      reply	other threads:[~2018-05-11 12:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-09 11:11 [PATCH v2 1/2] dmaengine: sprd: Optimize the sprd_dma_prep_dma_memcpy() Baolin Wang
2018-05-09 11:12 ` [PATCH v2 2/2] dmaengine: sprd: Add Spreadtrum DMA configuration Baolin Wang
2018-05-11 11:22   ` Vinod Koul
2018-05-11 11:44     ` Baolin Wang
2018-05-11 11:53       ` Vinod Koul
2018-05-11 11:58         ` Baolin Wang
2018-05-11 12:04           ` Vinod Koul
2018-05-11 12:20             ` Baolin Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMz4kuKP2+SGoAqQPkt2sFuh3DZiO=7tQ=KHrbPUwQBqn-Mkgw@mail.gmail.com' \
    --to=baolin.wang@linaro.org \
    --cc=broonie@kernel.org \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=eric.long@spreadtrum.com \
    --cc=lars@metafoo.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vinod.koul@linaro.org \
    --cc=vkoul@kernel.org \
    --subject='Re: [PATCH v2 2/2] dmaengine: sprd: Add Spreadtrum DMA configuration' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).