From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Ujfalusi Subject: Re: [PATCH 4/4] dmaengine: edma: Add support for DMA filter mapping to slave devices Date: Tue, 8 Dec 2015 15:15:31 +0200 Message-ID: <5666D7F3.4000708@ti.com> References: <1449153192-9082-1-git-send-email-peter.ujfalusi@ti.com> <1449153192-9082-5-git-send-email-peter.ujfalusi@ti.com> <2675730.x1sS4Fa4y8@wuerfel> <566063CA.20500@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <566063CA.20500@ti.com> Sender: linux-kernel-owner@vger.kernel.org To: Arnd Bergmann Cc: vinod.koul@intel.com, andy.shevchenko@gmail.com, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, nsekhar@ti.com, tony@atomide.com List-Id: linux-omap@vger.kernel.org On 12/03/2015 05:46 PM, Peter Ujfalusi wrote: > On 12/03/2015 05:38 PM, Arnd Bergmann wrote: >> On Thursday 03 December 2015 16:33:12 Peter Ujfalusi wrote: >>> diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c >>> index 0675e268d577..46b305ea0d21 100644 >>> --- a/drivers/dma/edma.c >>> +++ b/drivers/dma/edma.c >>> @@ -2297,6 +2297,12 @@ static int edma_probe(struct platform_device= *pdev) >>> edma_set_chmap(&ecc->slave_chans[i], ecc->dummy_slo= t); >>> } >>> =20 >>> + if (info->slave_map) { >>> + ecc->dma_slave.filter_map.map =3D info->slave_map; >>> + ecc->dma_slave.filter_map.mapcnt =3D info->slavecnt= ; >>> + ecc->dma_slave.filter_map.filter_fn =3D edma_filter= _fn; >>> + } >>> + >>> >> >> Just a minor comment here: I think all three assignments can be done >> unconditionally. >=20 > True. >=20 >> As I mentioned before, I'd also remove 'struct dma_filter' >> and put the three members in struct dma_device directly. In fact, th= e >> filter function can go with the other function pointers for consiste= ncy. >=20 > I just like to keep things in one place ;) > I don't have strong stand on keeping the intermediate 'struct dma_fil= ter' > Let's hear from Vinod regarding to this One remaining design issue is on how and where to place the filter rela= ted variables/pointers: Keep it separated as it was in the RFC and v01 series: struct dma_slave_map { const char *devname; const char *slave; void *param; }; struct dma_filter { dma_filter_fn fn; int mapcnt; const struct dma_slave_map *map; }; struct dma_device { ... struct dma_filter filter; ... }; Or to have them under the dma_device directly: struct dma_device { ... int filter_mapcnt; const struct dma_slave_map *filter_map; ... dma_filter_fn filter_fn; ... }; Vinod: what is your preference for this? Thanks, P=E9ter From mboxrd@z Thu Jan 1 00:00:00 1970 From: peter.ujfalusi@ti.com (Peter Ujfalusi) Date: Tue, 8 Dec 2015 15:15:31 +0200 Subject: [PATCH 4/4] dmaengine: edma: Add support for DMA filter mapping to slave devices In-Reply-To: <566063CA.20500@ti.com> References: <1449153192-9082-1-git-send-email-peter.ujfalusi@ti.com> <1449153192-9082-5-git-send-email-peter.ujfalusi@ti.com> <2675730.x1sS4Fa4y8@wuerfel> <566063CA.20500@ti.com> Message-ID: <5666D7F3.4000708@ti.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 12/03/2015 05:46 PM, Peter Ujfalusi wrote: > On 12/03/2015 05:38 PM, Arnd Bergmann wrote: >> On Thursday 03 December 2015 16:33:12 Peter Ujfalusi wrote: >>> diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c >>> index 0675e268d577..46b305ea0d21 100644 >>> --- a/drivers/dma/edma.c >>> +++ b/drivers/dma/edma.c >>> @@ -2297,6 +2297,12 @@ static int edma_probe(struct platform_device *pdev) >>> edma_set_chmap(&ecc->slave_chans[i], ecc->dummy_slot); >>> } >>> >>> + if (info->slave_map) { >>> + ecc->dma_slave.filter_map.map = info->slave_map; >>> + ecc->dma_slave.filter_map.mapcnt = info->slavecnt; >>> + ecc->dma_slave.filter_map.filter_fn = edma_filter_fn; >>> + } >>> + >>> >> >> Just a minor comment here: I think all three assignments can be done >> unconditionally. > > True. > >> As I mentioned before, I'd also remove 'struct dma_filter' >> and put the three members in struct dma_device directly. In fact, the >> filter function can go with the other function pointers for consistency. > > I just like to keep things in one place ;) > I don't have strong stand on keeping the intermediate 'struct dma_filter' > Let's hear from Vinod regarding to this One remaining design issue is on how and where to place the filter related variables/pointers: Keep it separated as it was in the RFC and v01 series: struct dma_slave_map { const char *devname; const char *slave; void *param; }; struct dma_filter { dma_filter_fn fn; int mapcnt; const struct dma_slave_map *map; }; struct dma_device { ... struct dma_filter filter; ... }; Or to have them under the dma_device directly: struct dma_device { ... int filter_mapcnt; const struct dma_slave_map *filter_map; ... dma_filter_fn filter_fn; ... }; Vinod: what is your preference for this? Thanks, P?ter From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756329AbbLHNQH (ORCPT ); Tue, 8 Dec 2015 08:16:07 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:52437 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755695AbbLHNQE (ORCPT ); Tue, 8 Dec 2015 08:16:04 -0500 Subject: Re: [PATCH 4/4] dmaengine: edma: Add support for DMA filter mapping to slave devices To: Arnd Bergmann References: <1449153192-9082-1-git-send-email-peter.ujfalusi@ti.com> <1449153192-9082-5-git-send-email-peter.ujfalusi@ti.com> <2675730.x1sS4Fa4y8@wuerfel> <566063CA.20500@ti.com> CC: , , , , , , , From: Peter Ujfalusi X-Enigmail-Draft-Status: N1110 Message-ID: <5666D7F3.4000708@ti.com> Date: Tue, 8 Dec 2015 15:15:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <566063CA.20500@ti.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/03/2015 05:46 PM, Peter Ujfalusi wrote: > On 12/03/2015 05:38 PM, Arnd Bergmann wrote: >> On Thursday 03 December 2015 16:33:12 Peter Ujfalusi wrote: >>> diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c >>> index 0675e268d577..46b305ea0d21 100644 >>> --- a/drivers/dma/edma.c >>> +++ b/drivers/dma/edma.c >>> @@ -2297,6 +2297,12 @@ static int edma_probe(struct platform_device *pdev) >>> edma_set_chmap(&ecc->slave_chans[i], ecc->dummy_slot); >>> } >>> >>> + if (info->slave_map) { >>> + ecc->dma_slave.filter_map.map = info->slave_map; >>> + ecc->dma_slave.filter_map.mapcnt = info->slavecnt; >>> + ecc->dma_slave.filter_map.filter_fn = edma_filter_fn; >>> + } >>> + >>> >> >> Just a minor comment here: I think all three assignments can be done >> unconditionally. > > True. > >> As I mentioned before, I'd also remove 'struct dma_filter' >> and put the three members in struct dma_device directly. In fact, the >> filter function can go with the other function pointers for consistency. > > I just like to keep things in one place ;) > I don't have strong stand on keeping the intermediate 'struct dma_filter' > Let's hear from Vinod regarding to this One remaining design issue is on how and where to place the filter related variables/pointers: Keep it separated as it was in the RFC and v01 series: struct dma_slave_map { const char *devname; const char *slave; void *param; }; struct dma_filter { dma_filter_fn fn; int mapcnt; const struct dma_slave_map *map; }; struct dma_device { ... struct dma_filter filter; ... }; Or to have them under the dma_device directly: struct dma_device { ... int filter_mapcnt; const struct dma_slave_map *filter_map; ... dma_filter_fn filter_fn; ... }; Vinod: what is your preference for this? Thanks, Péter