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: Mon, 1 May 2017 11:21:26 +0530 [thread overview]
Message-ID: <20170501055125.GN6263@localhost> (raw)
In-Reply-To: <20170428133746.1855-1-Eugeniy.Paltsev@synopsys.com>
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.
>
> Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev at synopsys.com>
> ---
> include/linux/dmaengine.h | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
> index 5336808..92cf8b0 100644
> --- a/include/linux/dmaengine.h
> +++ b/include/linux/dmaengine.h
> @@ -1376,11 +1376,7 @@ static inline int dma_get_slave_caps(struct dma_chan *chan,
>
> static inline int dmaengine_desc_set_reuse(struct dma_async_tx_descriptor *tx)
> {
> - struct dma_slave_caps caps;
> -
> - dma_get_slave_caps(tx->chan, &caps);
> -
> - if (caps.descriptor_reuse) {
> + if (tx->chan->device->descriptor_reuse) {
> tx->flags |= DMA_CTRL_REUSE;
> return 0;
> } else {
> --
> 2.9.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe dmaengine" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
~Vinod
next prev parent reply other threads:[~2017-05-01 5:51 UTC|newest]
Thread overview: 4+ 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-05-01 5:51 ` Vinod Koul [this message]
2017-05-02 15:16 ` Eugeniy Paltsev
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=20170501055125.GN6263@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 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).