From: vinod.koul@intel.com (Vinod Koul)
To: linux-snps-arc@lists.infradead.org
Subject: [PATCH] Allow to use DMA_CTRL_REUSE flag for all channel types
Date: Wed, 10 May 2017 09:25:07 +0530 [thread overview]
Message-ID: <20170510035507.GW6263@localhost> (raw)
In-Reply-To: <1493738176.25985.23.camel@synopsys.com>
On Tue, May 02, 2017@03:16:18PM +0000, Eugeniy Paltsev wrote:
> Hi Vinod,
>
> On Mon, 2017-05-01@11:21 +0530, Vinod Koul wrote:
> > On Fri, Apr 28, 2017@04:37:46PM +0300, Eugeniy Paltsev wrote:
> > > In the current implementation dma_get_slave_caps is used to check
> > > state of descriptor_reuse option. But dma_get_slave_caps includes
> > > check if the channel supports slave transactions.
> > > So DMA_CTRL_REUSE flag can be set (even for MEM-TO-MEM tranfers)
> > > only if channel supports slave transactions.
> > >
> > > Now we can use DMA_CTRL_REUSE flag for all channel types.
> > > Also it allows to test reusing mechanism with simply mem-to-mem dma
> > > test.
> >
> > We do not want to allow that actually. Slave is always treated as a
> > special
> > case, so resue was allowed.
> >
> > With memcpy the assumptions are different and clients can do reuse.
>
> Could you please clarify why don't we want to allow use DMA_CTRL_REUSE
> for mem-to-mem transfers?
>
> Reusing of mem-to-mem (MEMCPY and DMA_SG) descriptors will work fine on
> virt-dma based drivers.
Precisely, the client does not know if you have a virt-dma or some other
kind if implementation
For them they see a channel and use it!
> Anyway the current implementation behaviour is quite strange:
> If channel supports *slave* transfers DMA_CTRL_REUSE can be set to
> slave and *mem-to-mem* transfers.
>
> And, of course, we can pass DMA_CTRL_REUSE flag to device_prep_dma_sg
> or device_prep_dma_memcpy directly without checks.
Yeah thats bad, do send a patch to forbid that..
--
~Vinod
WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vinod.koul@intel.com>
To: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Cc: "dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"andriy.shevchenko@linux.intel.com"
<andriy.shevchenko@linux.intel.com>,
"dan.j.williams@intel.com" <dan.j.williams@intel.com>,
"Alexey.Brodkin@synopsys.com" <Alexey.Brodkin@synopsys.com>,
"linux-snps-arc@lists.infradead.org"
<linux-snps-arc@lists.infradead.org>
Subject: Re: [PATCH] Allow to use DMA_CTRL_REUSE flag for all channel types
Date: Wed, 10 May 2017 09:25:07 +0530 [thread overview]
Message-ID: <20170510035507.GW6263@localhost> (raw)
In-Reply-To: <1493738176.25985.23.camel@synopsys.com>
On Tue, May 02, 2017 at 03:16:18PM +0000, Eugeniy Paltsev wrote:
> Hi Vinod,
>
> On Mon, 2017-05-01 at 11:21 +0530, Vinod Koul wrote:
> > On Fri, Apr 28, 2017 at 04:37:46PM +0300, Eugeniy Paltsev wrote:
> > > In the current implementation dma_get_slave_caps is used to check
> > > state of descriptor_reuse option. But dma_get_slave_caps includes
> > > check if the channel supports slave transactions.
> > > So DMA_CTRL_REUSE flag can be set (even for MEM-TO-MEM tranfers)
> > > only if channel supports slave transactions.
> > >
> > > Now we can use DMA_CTRL_REUSE flag for all channel types.
> > > Also it allows to test reusing mechanism with simply mem-to-mem dma
> > > test.
> >
> > We do not want to allow that actually. Slave is always treated as a
> > special
> > case, so resue was allowed.
> >
> > With memcpy the assumptions are different and clients can do reuse.
>
> Could you please clarify why don't we want to allow use DMA_CTRL_REUSE
> for mem-to-mem transfers?
>
> Reusing of mem-to-mem (MEMCPY and DMA_SG) descriptors will work fine on
> virt-dma based drivers.
Precisely, the client does not know if you have a virt-dma or some other
kind if implementation
For them they see a channel and use it!
> Anyway the current implementation behaviour is quite strange:
> If channel supports *slave* transfers DMA_CTRL_REUSE can be set to
> slave and *mem-to-mem* transfers.
>
> And, of course, we can pass DMA_CTRL_REUSE flag to device_prep_dma_sg
> or device_prep_dma_memcpy directly without checks.
Yeah thats bad, do send a patch to forbid that..
--
~Vinod
next prev parent reply other threads:[~2017-05-10 3:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-28 13:37 [PATCH] Allow to use DMA_CTRL_REUSE flag for all channel types Eugeniy Paltsev
2017-04-28 13:37 ` Eugeniy Paltsev
2017-05-01 5:51 ` Vinod Koul
2017-05-01 5:51 ` Vinod Koul
2017-05-02 15:16 ` Eugeniy Paltsev
2017-05-02 15:16 ` Eugeniy Paltsev
2017-05-10 3:55 ` Vinod Koul [this message]
2017-05-10 3:55 ` Vinod Koul
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=20170510035507.GW6263@localhost \
--to=vinod.koul@intel.com \
--cc=linux-snps-arc@lists.infradead.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.