Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756522AbbLARES (ORCPT ); Tue, 1 Dec 2015 12:04:18 -0500 Received: from mga03.intel.com ([134.134.136.65]:34898 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754713AbbLAREQ (ORCPT ); Tue, 1 Dec 2015 12:04:16 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,369,1444719600"; d="scan'208";a="862311935" Date: Tue, 1 Dec 2015 22:36:47 +0530 From: Vinod Koul To: Andy Shevchenko Cc: Peter Ujfalusi , Arnd Bergmann , "linux-kernel@vger.kernel.org" , dmaengine , Linux OMAP Mailing List , linux-arm Mailing List , "linux-mmc@vger.kernel.org" , Sekhar Nori , linux-spi Subject: Re: [RFC v02 01/15] dmaengine: core: Allow NULL mask pointer in __dma_device_satisfies_mask() Message-ID: <20151201170647.GB1696@localhost> References: <1448891145-10766-1-git-send-email-peter.ujfalusi@ti.com> <1448891145-10766-2-git-send-email-peter.ujfalusi@ti.com> <565D6CB1.8030808@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Content-Length: 1967 Lines: 47 On Tue, Dec 01, 2015 at 02:58:35PM +0200, Andy Shevchenko wrote: > On Tue, Dec 1, 2015 at 11:47 AM, Peter Ujfalusi wrote: > > On 11/30/2015 04:35 PM, Andy Shevchenko wrote: > >> On Mon, Nov 30, 2015 at 3:45 PM, Peter Ujfalusi wrote: > >>> Treat as true condition the case when the mask is NULL. > >> > >> What do you think about setting some default (all "on") mask when mask > >> is not supplied? > > > > Probably rephrasing the commit message to say that when the mask is NULL it > > means that the caller does not care about the capabilities of the dma device > > thus return with true in such a case. > > > > We could also drop this patch and in private_candidate() : > > > > - if (!__dma_device_satisfies_mask(dev, mask)) { > > + if (mask && !__dma_device_satisfies_mask(dev, mask)) { > > pr_debug("%s: wrong capabilities\n", __func__); > > return NULL; > > } > > Between patch and above proposal I would choose the latter one. Sounds better to me as well > > >> I don't know for sure but there might be cases when you don't want > >> literally *any* channel to satisfy. > > > > Or set DMA_SLAVE only in dma_request_chan()? What happens if we have cases > > when we are able to request channel for memcpy via dma_request_chan() > > (dedicated memcpy channel/DMA engine?) in that case we will have the SLAVE > > set, but not MEMCPY, or any other variation we do not know yet? > > Frankly, have no idea. In slave cases I know that some controllers support memcpy but they are not generic memcpy as they cannot be used for system memcpy but for 'special' memcpy. So this can be used for memcpy as well -- ~Vinod -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/