From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753298AbdEAFtf (ORCPT ); Mon, 1 May 2017 01:49:35 -0400 Received: from mga06.intel.com ([134.134.136.31]:26099 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752482AbdEAFte (ORCPT ); Mon, 1 May 2017 01:49:34 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,399,1488873600"; d="scan'208";a="95765147" Date: Mon, 1 May 2017 11:21:26 +0530 From: Vinod Koul To: Eugeniy Paltsev Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org, Dan Williams , Andy Shevchenko , Alexey Brodkin Subject: Re: [PATCH] Allow to use DMA_CTRL_REUSE flag for all channel types Message-ID: <20170501055125.GN6263@localhost> References: <20170428133746.1855-1-Eugeniy.Paltsev@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170428133746.1855-1-Eugeniy.Paltsev@synopsys.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > > Signed-off-by: Eugeniy Paltsev > --- > 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@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- ~Vinod