From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751761AbdEJDxG (ORCPT ); Tue, 9 May 2017 23:53:06 -0400 Received: from mga04.intel.com ([192.55.52.120]:3061 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751434AbdEJDxF (ORCPT ); Tue, 9 May 2017 23:53:05 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,317,1491289200"; d="scan'208";a="99581287" Date: Wed, 10 May 2017 09:25:07 +0530 From: Vinod Koul To: Eugeniy Paltsev Cc: "dmaengine@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "andriy.shevchenko@linux.intel.com" , "dan.j.williams@intel.com" , "Alexey.Brodkin@synopsys.com" , "linux-snps-arc@lists.infradead.org" Subject: Re: [PATCH] Allow to use DMA_CTRL_REUSE flag for all channel types Message-ID: <20170510035507.GW6263@localhost> References: <20170428133746.1855-1-Eugeniy.Paltsev@synopsys.com> <20170501055125.GN6263@localhost> <1493738176.25985.23.camel@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1493738176.25985.23.camel@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 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