All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/15] ARM: pxa: switch to DMA slave maps
@ 2018-04-02 14:26 ` Robert Jarzmik
  0 siblings, 0 replies; 218+ messages in thread
From: Robert Jarzmik @ 2018-04-02 14:26 UTC (permalink / raw)
  To: Daniel Mack, Haojian Zhuang, Robert Jarzmik,
	Bartlomiej Zolnierkiewicz, Tejun Heo, Vinod Koul,
	Mauro Carvalho Chehab, Ulf Hansson, Ezequiel Garcia,
	Boris Brezillon, David Woodhouse, Brian Norris, Marek Vasut,
	Richard Weinberger, Cyrille Pitchen, Nicolas Pitre, Samuel Ortiz,
	Greg Kroah-Hartman
  Cc: linux-arm-kernel, linux-kernel, linux-ide, dmaengine,
	linux-media, linux-mmc, linux-mtd, netdev, devel, alsa-devel

Hi,

This serie is aimed at removing the dmaengine slave compat use, and transfer
knowledge of the DMA requestors into architecture code.

This was discussed/advised by Arnd a couple of years back, it's almost time.

The serie is divided in 3 phasees :
 - phase 1 : patch 1/15 and patch 2/15
   => this is the preparation work
 - phase 2 : patches 3/15 .. 10/15
   => this is the switch of all the drivers
   => this one will require either an Ack of the maintainers or be taken by them
      once phase 1 is merged
 - phase 3 : patches 11/15
   => this is the last part, cleanup and removal of export of the DMA filter
      function

As this looks like a patch bomb, each maintainer expressing for his tree either
an Ack or "I want to take through my tree" will be spared in the next iterations
of this serie.

Several of these changes have been tested on actual hardware, including :
 - pxamci
 - pxa_camera
 - smc*
 - ASoC and SSP

Happy review.

Robert Jarzmik (15):
  dmaengine: pxa: use a dma slave map
  ARM: pxa: add dma slave map
  mmc: pxamci: remove the dmaengine compat need
  media: pxa_camera: remove the dmaengine compat need
  mtd: nand: pxa3xx: remove the dmaengine compat need
  net: smc911x: remove the dmaengine compat need
  net: smc91x: remove the dmaengine compat need
  ASoC: pxa: remove the dmaengine compat need
  net: irda: pxaficp_ir: remove the dmaengine compat need
  ata: pata_pxa: remove the dmaengine compat need
  dmaengine: pxa: document pxad_param
  dmaengine: pxa: make the filter function internal
  ARM: pxa: remove the DMA IO resources
  ARM: pxa: change SSP devices allocation
  ARM: pxa: change SSP DMA channels allocation

 arch/arm/mach-pxa/devices.c               | 269 ++++++++++++++----------------
 arch/arm/mach-pxa/devices.h               |  14 +-
 arch/arm/mach-pxa/include/mach/audio.h    |  12 ++
 arch/arm/mach-pxa/pxa25x.c                |   4 +-
 arch/arm/mach-pxa/pxa27x.c                |   4 +-
 arch/arm/mach-pxa/pxa3xx.c                |   5 +-
 arch/arm/plat-pxa/ssp.c                   |  50 +-----
 drivers/ata/pata_pxa.c                    |  10 +-
 drivers/dma/pxa_dma.c                     |  13 +-
 drivers/media/platform/pxa_camera.c       |  22 +--
 drivers/mmc/host/pxamci.c                 |  29 +---
 drivers/mtd/nand/pxa3xx_nand.c            |  10 +-
 drivers/net/ethernet/smsc/smc911x.c       |  16 +-
 drivers/net/ethernet/smsc/smc91x.c        |  12 +-
 drivers/net/ethernet/smsc/smc91x.h        |   1 -
 drivers/staging/irda/drivers/pxaficp_ir.c |  14 +-
 include/linux/dma/pxa-dma.h               |  20 +--
 include/linux/platform_data/mmp_dma.h     |   4 +
 include/linux/pxa2xx_ssp.h                |   4 +-
 sound/arm/pxa2xx-ac97.c                   |  14 +-
 sound/arm/pxa2xx-pcm-lib.c                |   6 +-
 sound/soc/pxa/pxa-ssp.c                   |   5 +-
 sound/soc/pxa/pxa2xx-ac97.c               |  32 +---
 23 files changed, 196 insertions(+), 374 deletions(-)

-- 
2.11.0

^ permalink raw reply	[flat|nested] 218+ messages in thread
* [02/15] ARM: pxa: add dma slave map
  2018-04-02 14:26 ` Robert Jarzmik
  (?)
  (?)
@ 2018-04-02 14:26 ` Robert Jarzmik
  -1 siblings, 0 replies; 218+ messages in thread
From: Robert Jarzmik @ 2018-04-02 14:26 UTC (permalink / raw)
  To: Daniel Mack, Haojian Zhuang, Robert Jarzmik,
	Bartlomiej Zolnierkiewicz, Tejun Heo, Vinod Koul,
	Mauro Carvalho Chehab, Ulf Hansson, Ezequiel Garcia,
	Boris Brezillon, David Woodhouse, Brian Norris, Marek Vasut,
	Richard Weinberger, Cyrille Pitchen, Nicolas Pitre, Samuel Ortiz,
	Greg Kroah-Hartman, Jaroslav Kysela, Takashi Iwai, Liam Girdwood,
	Mark Brown, Arnd Bergmann, Russell King
  Cc: linux-arm-kernel, linux-kernel, linux-ide, dmaengine,
	linux-media, linux-mmc, linux-mtd, netdev, devel, alsa-devel

In order to remove the specific knowledge of the dma mapping from PXA
drivers, add a default slave map for pxa architectures.

This is the first step, and once all drivers are converted,
pxad_filter_fn() will be made static, and the DMA resources removed from
device.c.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Reported-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-pxa/devices.c | 55 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c
index d7c9a8476d57..da67ebe9a7d5 100644
--- a/arch/arm/mach-pxa/devices.c
+++ b/arch/arm/mach-pxa/devices.c
@@ -4,6 +4,8 @@
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
+#include <linux/dma/pxa-dma.h>
+#include <linux/dmaengine.h>
 #include <linux/spi/pxa2xx_spi.h>
 #include <linux/platform_data/i2c-pxa.h>
 
@@ -1202,9 +1204,62 @@ void __init pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info)
 	platform_device_add(pd);
 }
 
+#define PDMA_FILTER_PARAM(_prio, _requestor) (&(struct pxad_param) { \
+	.prio = PXAD_PRIO_##_prio, .drcmr = _requestor })
+
+static const struct dma_slave_map pxa_slave_map[] = {
+	/* PXA25x, PXA27x and PXA3xx common entries */
+	{ "pxa-pcm-audio", "ac97_mic_mono", PDMA_FILTER_PARAM(LOWEST, 8) },
+	{ "pxa-pcm-audio", "ac97_aux_mono_in", PDMA_FILTER_PARAM(LOWEST, 9) },
+	{ "pxa-pcm-audio", "ac97_aux_mono_out", PDMA_FILTER_PARAM(LOWEST, 10) },
+	{ "pxa-pcm-audio", "ac97_stereo_in", PDMA_FILTER_PARAM(LOWEST, 11) },
+	{ "pxa-pcm-audio", "ac97_stereo_out", PDMA_FILTER_PARAM(LOWEST, 12) },
+	{ "pxa-pcm-audio", "ssp1_rx", PDMA_FILTER_PARAM(LOWEST, 13) },
+	{ "pxa-pcm-audio", "ssp1_tx", PDMA_FILTER_PARAM(LOWEST, 14) },
+	{ "pxa-pcm-audio", "ssp2_rx", PDMA_FILTER_PARAM(LOWEST, 15) },
+	{ "pxa-pcm-audio", "ssp2_tx", PDMA_FILTER_PARAM(LOWEST, 16) },
+	{ "pxa2xx-ir", "rx", PDMA_FILTER_PARAM(LOWEST, 17) },
+	{ "pxa2xx-ir", "tx", PDMA_FILTER_PARAM(LOWEST, 18) },
+	{ "pxa2xx-mci.0", "rx", PDMA_FILTER_PARAM(LOWEST, 21) },
+	{ "pxa2xx-mci.0", "tx", PDMA_FILTER_PARAM(LOWEST, 22) },
+	{ "smc911x.0", "rx", PDMA_FILTER_PARAM(LOWEST, -1) },
+	{ "smc911x.0", "tx", PDMA_FILTER_PARAM(LOWEST, -1) },
+	{ "smc91x.0", "data", PDMA_FILTER_PARAM(LOWEST, -1) },
+
+	/* PXA25x specific map */
+	{ "pxa25x-ssp.0", "rx", PDMA_FILTER_PARAM(LOWEST, 13) },
+	{ "pxa25x-ssp.0", "tx", PDMA_FILTER_PARAM(LOWEST, 14) },
+	{ "pxa25x-nssp.1", "rx", PDMA_FILTER_PARAM(LOWEST, 15) },
+	{ "pxa25x-nssp.1", "tx", PDMA_FILTER_PARAM(LOWEST, 16) },
+	{ "pxa25x-nssp.2", "rx", PDMA_FILTER_PARAM(LOWEST, 23) },
+	{ "pxa25x-nssp.2", "tx", PDMA_FILTER_PARAM(LOWEST, 24) },
+	{ "pxa-pcm-audio", "nssp2_rx", PDMA_FILTER_PARAM(LOWEST, 15) },
+	{ "pxa-pcm-audio", "nssp2_tx", PDMA_FILTER_PARAM(LOWEST, 16) },
+	{ "pxa-pcm-audio", "nssp3_rx", PDMA_FILTER_PARAM(LOWEST, 23) },
+	{ "pxa-pcm-audio", "nssp3_tx", PDMA_FILTER_PARAM(LOWEST, 24) },
+
+	/* PXA27x specific map */
+	{ "pxa-pcm-audio", "ssp3_rx", PDMA_FILTER_PARAM(LOWEST, 66) },
+	{ "pxa-pcm-audio", "ssp3_tx", PDMA_FILTER_PARAM(LOWEST, 67) },
+	{ "pxa27x-camera.0", "CI_Y", PDMA_FILTER_PARAM(HIGHEST, 68) },
+	{ "pxa27x-camera.0", "CI_U", PDMA_FILTER_PARAM(HIGHEST, 69) },
+	{ "pxa27x-camera.0", "CI_V", PDMA_FILTER_PARAM(HIGHEST, 70) },
+
+	/* PXA3xx specific map */
+	{ "pxa-pcm-audio", "ssp4_rx", PDMA_FILTER_PARAM(LOWEST, 2) },
+	{ "pxa-pcm-audio", "ssp4_tx", PDMA_FILTER_PARAM(LOWEST, 3) },
+	{ "pxa2xx-mci.1", "rx", PDMA_FILTER_PARAM(LOWEST, 93) },
+	{ "pxa2xx-mci.1", "tx", PDMA_FILTER_PARAM(LOWEST, 94) },
+	{ "pxa3xx-nand", "data", PDMA_FILTER_PARAM(LOWEST, 97) },
+	{ "pxa2xx-mci.2", "rx", PDMA_FILTER_PARAM(LOWEST, 100) },
+	{ "pxa2xx-mci.2", "tx", PDMA_FILTER_PARAM(LOWEST, 101) },
+};
+
 static struct mmp_dma_platdata pxa_dma_pdata = {
 	.dma_channels	= 0,
 	.nb_requestors	= 0,
+	.slave_map	= pxa_slave_map,
+	.slave_map_cnt	= ARRAY_SIZE(pxa_slave_map),
 };
 
 static struct resource pxa_dma_resource[] = {

^ permalink raw reply related	[flat|nested] 218+ messages in thread
* [03/15] mmc: pxamci: remove the dmaengine compat need
  2018-04-02 14:26 ` Robert Jarzmik
                   ` (2 preceding siblings ...)
  (?)
@ 2018-04-02 14:26 ` Robert Jarzmik
  -1 siblings, 0 replies; 218+ messages in thread
From: Robert Jarzmik @ 2018-04-02 14:26 UTC (permalink / raw)
  To: Daniel Mack, Haojian Zhuang, Robert Jarzmik,
	Bartlomiej Zolnierkiewicz, Tejun Heo, Vinod Koul,
	Mauro Carvalho Chehab, Ulf Hansson, Ezequiel Garcia,
	Boris Brezillon, David Woodhouse, Brian Norris, Marek Vasut,
	Richard Weinberger, Cyrille Pitchen, Nicolas Pitre, Samuel Ortiz,
	Greg Kroah-Hartman, Jaroslav Kysela, Takashi Iwai, Liam Girdwood,
	Mark Brown, Arnd Bergmann, Linus Walleij
  Cc: linux-arm-kernel, linux-kernel, linux-ide, dmaengine,
	linux-media, linux-mmc, linux-mtd, netdev, devel, alsa-devel

As the pxa architecture switched towards the dmaengine slave map, the
old compatibility mechanism to acquire the dma requestor line number and
priority are not needed anymore.

This patch simplifies the dma resource acquisition, using the more
generic function dma_request_slave_channel().

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
---
 drivers/mmc/host/pxamci.c | 29 +++--------------------------
 1 file changed, 3 insertions(+), 26 deletions(-)

diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
index c763b404510f..6c94474e36f4 100644
--- a/drivers/mmc/host/pxamci.c
+++ b/drivers/mmc/host/pxamci.c
@@ -24,7 +24,6 @@
 #include <linux/interrupt.h>
 #include <linux/dmaengine.h>
 #include <linux/dma-mapping.h>
-#include <linux/dma/pxa-dma.h>
 #include <linux/clk.h>
 #include <linux/err.h>
 #include <linux/mmc/host.h>
@@ -637,10 +636,8 @@ static int pxamci_probe(struct platform_device *pdev)
 {
 	struct mmc_host *mmc;
 	struct pxamci_host *host = NULL;
-	struct resource *r, *dmarx, *dmatx;
-	struct pxad_param param_rx, param_tx;
+	struct resource *r;
 	int ret, irq, gpio_cd = -1, gpio_ro = -1, gpio_power = -1;
-	dma_cap_mask_t mask;
 
 	ret = pxamci_of_init(pdev);
 	if (ret)
@@ -739,34 +736,14 @@ static int pxamci_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, mmc);
 
-	if (!pdev->dev.of_node) {
-		dmarx = platform_get_resource(pdev, IORESOURCE_DMA, 0);
-		dmatx = platform_get_resource(pdev, IORESOURCE_DMA, 1);
-		if (!dmarx || !dmatx) {
-			ret = -ENXIO;
-			goto out;
-		}
-		param_rx.prio = PXAD_PRIO_LOWEST;
-		param_rx.drcmr = dmarx->start;
-		param_tx.prio = PXAD_PRIO_LOWEST;
-		param_tx.drcmr = dmatx->start;
-	}
-
-	dma_cap_zero(mask);
-	dma_cap_set(DMA_SLAVE, mask);
-
-	host->dma_chan_rx =
-		dma_request_slave_channel_compat(mask, pxad_filter_fn,
-						 &param_rx, &pdev->dev, "rx");
+	host->dma_chan_rx = dma_request_slave_channel(&pdev->dev, "rx");
 	if (host->dma_chan_rx == NULL) {
 		dev_err(&pdev->dev, "unable to request rx dma channel\n");
 		ret = -ENODEV;
 		goto out;
 	}
 
-	host->dma_chan_tx =
-		dma_request_slave_channel_compat(mask, pxad_filter_fn,
-						 &param_tx,  &pdev->dev, "tx");
+	host->dma_chan_tx = dma_request_slave_channel(&pdev->dev, "tx");
 	if (host->dma_chan_tx == NULL) {
 		dev_err(&pdev->dev, "unable to request tx dma channel\n");
 		ret = -ENODEV;

^ permalink raw reply related	[flat|nested] 218+ messages in thread
* [06/15] net: smc911x: remove the dmaengine compat need
  2018-04-02 14:26 ` Robert Jarzmik
                   ` (2 preceding siblings ...)
  (?)
@ 2018-04-02 14:26 ` Robert Jarzmik
  -1 siblings, 0 replies; 218+ messages in thread
From: Robert Jarzmik @ 2018-04-02 14:26 UTC (permalink / raw)
  To: Daniel Mack, Haojian Zhuang, Robert Jarzmik,
	Bartlomiej Zolnierkiewicz, Tejun Heo, Vinod Koul,
	Mauro Carvalho Chehab, Ulf Hansson, Ezequiel Garcia,
	Boris Brezillon, David Woodhouse, Brian Norris, Marek Vasut,
	Richard Weinberger, Cyrille Pitchen, Nicolas Pitre, Samuel Ortiz,
	Greg Kroah-Hartman, Jaroslav Kysela, Takashi Iwai, Liam Girdwood,
	Mark Brown, Arnd Bergmann, David S. Miller, yuval.shaia,
	Robert Jarzmik
  Cc: linux-arm-kernel, linux-kernel, linux-ide, dmaengine,
	linux-media, linux-mmc, linux-mtd, netdev, devel, alsa-devel

From: Robert Jarzmik <robert.jarzmik@renault.com>

As the pxa architecture switched towards the dmaengine slave map, the
old compatibility mechanism to acquire the dma requestor line number and
priority are not needed anymore.

This patch simplifies the dma resource acquisition, using the more
generic function dma_request_slave_channel().

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
---
 drivers/net/ethernet/smsc/smc911x.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/net/ethernet/smsc/smc911x.c b/drivers/net/ethernet/smsc/smc911x.c
index 05157442a980..4c3713bd5caa 100644
--- a/drivers/net/ethernet/smsc/smc911x.c
+++ b/drivers/net/ethernet/smsc/smc911x.c
@@ -74,7 +74,6 @@ static const char version[] =
 #include <linux/skbuff.h>
 
 #include <linux/dmaengine.h>
-#include <linux/dma/pxa-dma.h>
 
 #include <asm/io.h>
 
@@ -1794,8 +1793,6 @@ static int smc911x_probe(struct net_device *dev)
 	unsigned long irq_flags;
 #ifdef SMC_USE_DMA
 	struct dma_slave_config	config;
-	dma_cap_mask_t mask;
-	struct pxad_param param;
 #endif
 
 	DBG(SMC_DEBUG_FUNC, dev, "--> %s\n", __func__);
@@ -1969,17 +1966,8 @@ static int smc911x_probe(struct net_device *dev)
 
 #ifdef SMC_USE_DMA
 
-	dma_cap_zero(mask);
-	dma_cap_set(DMA_SLAVE, mask);
-	param.prio = PXAD_PRIO_LOWEST;
-	param.drcmr = -1UL;
-
-	lp->rxdma =
-		dma_request_slave_channel_compat(mask, pxad_filter_fn,
-						 &param, &dev->dev, "rx");
-	lp->txdma =
-		dma_request_slave_channel_compat(mask, pxad_filter_fn,
-						 &param, &dev->dev, "tx");
+	lp->rxdma = dma_request_slave_channel(&dev->dev, "rx");
+	lp->txdma = dma_request_slave_channel(&dev->dev, "tx");
 	lp->rxdma_active = 0;
 	lp->txdma_active = 0;
 

^ permalink raw reply related	[flat|nested] 218+ messages in thread
* [07/15] net: smc91x: remove the dmaengine compat need
  2018-04-02 14:26 ` Robert Jarzmik
                   ` (2 preceding siblings ...)
  (?)
@ 2018-04-02 14:26 ` Robert Jarzmik
  -1 siblings, 0 replies; 218+ messages in thread
From: Robert Jarzmik @ 2018-04-02 14:26 UTC (permalink / raw)
  To: Daniel Mack, Haojian Zhuang, Robert Jarzmik,
	Bartlomiej Zolnierkiewicz, Tejun Heo, Vinod Koul,
	Mauro Carvalho Chehab, Ulf Hansson, Ezequiel Garcia,
	Boris Brezillon, David Woodhouse, Brian Norris, Marek Vasut,
	Richard Weinberger, Cyrille Pitchen, Nicolas Pitre, Samuel Ortiz,
	Greg Kroah-Hartman, Jaroslav Kysela, Takashi Iwai, Liam Girdwood,
	Mark Brown, Arnd Bergmann, David S. Miller, Robert Jarzmik,
	yuval.shaia, Arvind Yadav
  Cc: linux-arm-kernel, linux-kernel, linux-ide, dmaengine,
	linux-media, linux-mmc, linux-mtd, netdev, devel, alsa-devel

From: Robert Jarzmik <robert.jarzmik@renault.com>

As the pxa architecture switched towards the dmaengine slave map, the
old compatibility mechanism to acquire the dma requestor line number and
priority are not needed anymore.

This patch simplifies the dma resource acquisition, using the more
generic function dma_request_slave_channel().

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
---
 drivers/net/ethernet/smsc/smc91x.c | 12 +-----------
 drivers/net/ethernet/smsc/smc91x.h |  1 -
 2 files changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c
index 080428762858..4c600f430f6d 100644
--- a/drivers/net/ethernet/smsc/smc91x.c
+++ b/drivers/net/ethernet/smsc/smc91x.c
@@ -2018,18 +2018,8 @@ static int smc_probe(struct net_device *dev, void __iomem *ioaddr,
 	lp->cfg.flags |= SMC91X_USE_DMA;
 #  endif
 	if (lp->cfg.flags & SMC91X_USE_DMA) {
-		dma_cap_mask_t mask;
-		struct pxad_param param;
-
-		dma_cap_zero(mask);
-		dma_cap_set(DMA_SLAVE, mask);
-		param.prio = PXAD_PRIO_LOWEST;
-		param.drcmr = -1UL;
-
 		lp->dma_chan =
-			dma_request_slave_channel_compat(mask, pxad_filter_fn,
-							 &param, &dev->dev,
-							 "data");
+			dma_request_slave_channel(lp->device, "data");
 	}
 #endif
 
diff --git a/drivers/net/ethernet/smsc/smc91x.h b/drivers/net/ethernet/smsc/smc91x.h
index 08b17adf0a65..e849b6c2fa60 100644
--- a/drivers/net/ethernet/smsc/smc91x.h
+++ b/drivers/net/ethernet/smsc/smc91x.h
@@ -327,7 +327,6 @@ struct smc_local {
  * as RX which can overrun memory and lose packets.
  */
 #include <linux/dma-mapping.h>
-#include <linux/dma/pxa-dma.h>
 
 #ifdef SMC_insl
 #undef SMC_insl

^ permalink raw reply related	[flat|nested] 218+ messages in thread
* [08/15] ASoC: pxa: remove the dmaengine compat need
  2018-04-02 14:26 ` Robert Jarzmik
                   ` (2 preceding siblings ...)
  (?)
@ 2018-04-02 14:26 ` Robert Jarzmik
  -1 siblings, 0 replies; 218+ messages in thread
From: Robert Jarzmik @ 2018-04-02 14:26 UTC (permalink / raw)
  To: Daniel Mack, Haojian Zhuang, Robert Jarzmik,
	Bartlomiej Zolnierkiewicz, Tejun Heo, Vinod Koul,
	Mauro Carvalho Chehab, Ulf Hansson, Ezequiel Garcia,
	Boris Brezillon, David Woodhouse, Brian Norris, Marek Vasut,
	Richard Weinberger, Cyrille Pitchen, Nicolas Pitre, Samuel Ortiz,
	Greg Kroah-Hartman, Jaroslav Kysela, Takashi Iwai, Liam Girdwood,
	Mark Brown, Arnd Bergmann
  Cc: linux-arm-kernel, linux-kernel, linux-ide, dmaengine,
	linux-media, linux-mmc, linux-mtd, netdev, devel, alsa-devel

As the pxa architecture switched towards the dmaengine slave map, the
old compatibility mechanism to acquire the dma requestor line number and
priority are not needed anymore.

This patch simplifies the dma resource acquisition, using the more
generic function dma_request_slave_channel().

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
---
 sound/arm/pxa2xx-ac97.c     | 14 ++------------
 sound/arm/pxa2xx-pcm-lib.c  |  6 +++---
 sound/soc/pxa/pxa2xx-ac97.c | 32 +++++---------------------------
 3 files changed, 10 insertions(+), 42 deletions(-)

diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c
index 4bc244c40f80..236a63cdaf9f 100644
--- a/sound/arm/pxa2xx-ac97.c
+++ b/sound/arm/pxa2xx-ac97.c
@@ -63,28 +63,18 @@ static struct snd_ac97_bus_ops pxa2xx_ac97_ops = {
 	.reset	= pxa2xx_ac97_legacy_reset,
 };
 
-static struct pxad_param pxa2xx_ac97_pcm_out_req = {
-	.prio = PXAD_PRIO_LOWEST,
-	.drcmr = 12,
-};
-
 static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_out = {
 	.addr		= __PREG(PCDR),
 	.addr_width	= DMA_SLAVE_BUSWIDTH_4_BYTES,
+	.chan_name	= "pcm_pcm_stereo_out",
 	.maxburst	= 32,
-	.filter_data	= &pxa2xx_ac97_pcm_out_req,
-};
-
-static struct pxad_param pxa2xx_ac97_pcm_in_req = {
-	.prio = PXAD_PRIO_LOWEST,
-	.drcmr = 11,
 };
 
 static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_in = {
 	.addr		= __PREG(PCDR),
 	.addr_width	= DMA_SLAVE_BUSWIDTH_4_BYTES,
+	.chan_name	= "pcm_pcm_stereo_in",
 	.maxburst	= 32,
-	.filter_data	= &pxa2xx_ac97_pcm_in_req,
 };
 
 static struct snd_pcm *pxa2xx_ac97_pcm;
diff --git a/sound/arm/pxa2xx-pcm-lib.c b/sound/arm/pxa2xx-pcm-lib.c
index e8da3b8ee721..cbfaba60b79a 100644
--- a/sound/arm/pxa2xx-pcm-lib.c
+++ b/sound/arm/pxa2xx-pcm-lib.c
@@ -125,9 +125,9 @@ int __pxa2xx_pcm_open(struct snd_pcm_substream *substream)
 	if (ret < 0)
 		return ret;
 
-	return snd_dmaengine_pcm_open_request_chan(substream,
-					pxad_filter_fn,
-					dma_params->filter_data);
+	return snd_dmaengine_pcm_open(
+		substream, dma_request_slave_channel(rtd->platform->dev,
+						     dma_params->chan_name));
 }
 EXPORT_SYMBOL(__pxa2xx_pcm_open);
 
diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c
index 803818aabee9..1b41c0f2a8fb 100644
--- a/sound/soc/pxa/pxa2xx-ac97.c
+++ b/sound/soc/pxa/pxa2xx-ac97.c
@@ -68,61 +68,39 @@ static struct snd_ac97_bus_ops pxa2xx_ac97_ops = {
 	.reset	= pxa2xx_ac97_cold_reset,
 };
 
-static struct pxad_param pxa2xx_ac97_pcm_stereo_in_req = {
-	.prio = PXAD_PRIO_LOWEST,
-	.drcmr = 11,
-};
-
 static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_in = {
 	.addr		= __PREG(PCDR),
 	.addr_width	= DMA_SLAVE_BUSWIDTH_4_BYTES,
+	.chan_name	= "pcm_pcm_stereo_in",
 	.maxburst	= 32,
-	.filter_data	= &pxa2xx_ac97_pcm_stereo_in_req,
-};
-
-static struct pxad_param pxa2xx_ac97_pcm_stereo_out_req = {
-	.prio = PXAD_PRIO_LOWEST,
-	.drcmr = 12,
 };
 
 static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_out = {
 	.addr		= __PREG(PCDR),
 	.addr_width	= DMA_SLAVE_BUSWIDTH_4_BYTES,
+	.chan_name	= "pcm_pcm_stereo_out",
 	.maxburst	= 32,
-	.filter_data	= &pxa2xx_ac97_pcm_stereo_out_req,
 };
 
-static struct pxad_param pxa2xx_ac97_pcm_aux_mono_out_req = {
-	.prio = PXAD_PRIO_LOWEST,
-	.drcmr = 10,
-};
 static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_aux_mono_out = {
 	.addr		= __PREG(MODR),
 	.addr_width	= DMA_SLAVE_BUSWIDTH_2_BYTES,
+	.chan_name	= "pcm_aux_mono_out",
 	.maxburst	= 16,
-	.filter_data	= &pxa2xx_ac97_pcm_aux_mono_out_req,
 };
 
-static struct pxad_param pxa2xx_ac97_pcm_aux_mono_in_req = {
-	.prio = PXAD_PRIO_LOWEST,
-	.drcmr = 9,
-};
 static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_aux_mono_in = {
 	.addr		= __PREG(MODR),
 	.addr_width	= DMA_SLAVE_BUSWIDTH_2_BYTES,
+	.chan_name	= "pcm_aux_mono_in",
 	.maxburst	= 16,
-	.filter_data	= &pxa2xx_ac97_pcm_aux_mono_in_req,
 };
 
-static struct pxad_param pxa2xx_ac97_pcm_aux_mic_mono_req = {
-	.prio = PXAD_PRIO_LOWEST,
-	.drcmr = 8,
-};
 static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_mic_mono_in = {
 	.addr		= __PREG(MCDR),
 	.addr_width	= DMA_SLAVE_BUSWIDTH_2_BYTES,
+	.chan_name	= "pcm_aux_mic_mono",
 	.maxburst	= 16,
-	.filter_data	= &pxa2xx_ac97_pcm_aux_mic_mono_req,
 };
 
 static int pxa2xx_ac97_hifi_startup(struct snd_pcm_substream *substream,

^ permalink raw reply related	[flat|nested] 218+ messages in thread
* [11/15] dmaengine: pxa: document pxad_param
  2018-04-02 14:26 ` Robert Jarzmik
                   ` (2 preceding siblings ...)
  (?)
@ 2018-04-02 14:26 ` Robert Jarzmik
  -1 siblings, 0 replies; 218+ messages in thread
From: Robert Jarzmik @ 2018-04-02 14:26 UTC (permalink / raw)
  To: Daniel Mack, Haojian Zhuang, Robert Jarzmik,
	Bartlomiej Zolnierkiewicz, Tejun Heo, Vinod Koul,
	Mauro Carvalho Chehab, Ulf Hansson, Ezequiel Garcia,
	Boris Brezillon, David Woodhouse, Brian Norris, Marek Vasut,
	Richard Weinberger, Cyrille Pitchen, Nicolas Pitre, Samuel Ortiz,
	Greg Kroah-Hartman, Jaroslav Kysela, Takashi Iwai, Liam Girdwood,
	Mark Brown, Arnd Bergmann, Philippe Ombredanne, Kate Stewart,
	Thomas Gleixner
  Cc: linux-arm-kernel, linux-kernel, linux-ide, dmaengine,
	linux-media, linux-mmc, linux-mtd, netdev, devel, alsa-devel

Add some documentation for the pxad_param structure, and describe the
contract behind the minimal required priority of a DMA channel.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
---
 include/linux/dma/pxa-dma.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/linux/dma/pxa-dma.h b/include/linux/dma/pxa-dma.h
index e56ec7af4fd7..9fc594f69eff 100644
--- a/include/linux/dma/pxa-dma.h
+++ b/include/linux/dma/pxa-dma.h
@@ -9,6 +9,15 @@ enum pxad_chan_prio {
 	PXAD_PRIO_LOWEST,
 };
 
+/**
+ * struct pxad_param - dma channel request parameters
+ * @drcmr: requestor line number
+ * @prio: minimal mandatory priority of the channel
+ *
+ * If a requested channel is granted, its priority will be at least @prio,
+ * ie. if PXAD_PRIO_LOW is required, the requested channel will be either
+ * PXAD_PRIO_LOW, PXAD_PRIO_NORMAL or PXAD_PRIO_HIGHEST.
+ */
 struct pxad_param {
 	unsigned int drcmr;
 	enum pxad_chan_prio prio;

^ permalink raw reply related	[flat|nested] 218+ messages in thread
* [12/15] dmaengine: pxa: make the filter function internal
  2018-04-02 14:26 ` Robert Jarzmik
                   ` (2 preceding siblings ...)
  (?)
@ 2018-04-02 14:26 ` Robert Jarzmik
  -1 siblings, 0 replies; 218+ messages in thread
From: Robert Jarzmik @ 2018-04-02 14:26 UTC (permalink / raw)
  To: Daniel Mack, Haojian Zhuang, Robert Jarzmik,
	Bartlomiej Zolnierkiewicz, Tejun Heo, Vinod Koul,
	Mauro Carvalho Chehab, Ulf Hansson, Ezequiel Garcia,
	Boris Brezillon, David Woodhouse, Brian Norris, Marek Vasut,
	Richard Weinberger, Cyrille Pitchen, Nicolas Pitre, Samuel Ortiz,
	Greg Kroah-Hartman, Jaroslav Kysela, Takashi Iwai, Liam Girdwood,
	Mark Brown, Arnd Bergmann, Thomas Gleixner, Philippe Ombredanne,
	Kate Stewart
  Cc: linux-arm-kernel, linux-kernel, linux-ide, dmaengine,
	linux-media, linux-mmc, linux-mtd, netdev, devel, alsa-devel

As the pxa architecture and all its related drivers do not rely anymore
on the filter function, thanks to the slave map conversion, make
pxad_filter_fn() static, and remove it from the global namespace.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
---
 drivers/dma/pxa_dma.c       |  5 ++---
 include/linux/dma/pxa-dma.h | 11 -----------
 2 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/dma/pxa_dma.c b/drivers/dma/pxa_dma.c
index 9505334f9c6e..a332ad1d7dfb 100644
--- a/drivers/dma/pxa_dma.c
+++ b/drivers/dma/pxa_dma.c
@@ -179,7 +179,7 @@ static unsigned int pxad_drcmr(unsigned int line)
 	return 0x1000 + line * 4;
 }
 
-bool pxad_filter_fn(struct dma_chan *chan, void *param);
+static bool pxad_filter_fn(struct dma_chan *chan, void *param);
 
 /*
  * Debug fs
@@ -1496,7 +1496,7 @@ static struct platform_driver pxad_driver = {
 	.remove		= pxad_remove,
 };
 
-bool pxad_filter_fn(struct dma_chan *chan, void *param)
+static bool pxad_filter_fn(struct dma_chan *chan, void *param)
 {
 	struct pxad_chan *c = to_pxad_chan(chan);
 	struct pxad_param *p = param;
@@ -1509,7 +1509,6 @@ bool pxad_filter_fn(struct dma_chan *chan, void *param)
 
 	return true;
 }
-EXPORT_SYMBOL_GPL(pxad_filter_fn);
 
 module_platform_driver(pxad_driver);
 
diff --git a/include/linux/dma/pxa-dma.h b/include/linux/dma/pxa-dma.h
index 9fc594f69eff..fceb5df07097 100644
--- a/include/linux/dma/pxa-dma.h
+++ b/include/linux/dma/pxa-dma.h
@@ -23,15 +23,4 @@ struct pxad_param {
 	enum pxad_chan_prio prio;
 };
 
-struct dma_chan;
-
-#ifdef CONFIG_PXA_DMA
-bool pxad_filter_fn(struct dma_chan *chan, void *param);
-#else
-static inline bool pxad_filter_fn(struct dma_chan *chan, void *param)
-{
-	return false;
-}
-#endif
-
 #endif /* _PXA_DMA_H_ */

^ permalink raw reply related	[flat|nested] 218+ messages in thread
* [13/15] ARM: pxa: remove the DMA IO resources
  2018-04-02 14:26 ` Robert Jarzmik
                   ` (2 preceding siblings ...)
  (?)
@ 2018-04-02 14:26 ` Robert Jarzmik
  -1 siblings, 0 replies; 218+ messages in thread
From: Robert Jarzmik @ 2018-04-02 14:26 UTC (permalink / raw)
  To: Daniel Mack, Haojian Zhuang, Robert Jarzmik,
	Bartlomiej Zolnierkiewicz, Tejun Heo, Vinod Koul,
	Mauro Carvalho Chehab, Ulf Hansson, Ezequiel Garcia,
	Boris Brezillon, David Woodhouse, Brian Norris, Marek Vasut,
	Richard Weinberger, Cyrille Pitchen, Nicolas Pitre, Samuel Ortiz,
	Greg Kroah-Hartman, Jaroslav Kysela, Takashi Iwai, Liam Girdwood,
	Mark Brown, Arnd Bergmann, Russell King
  Cc: linux-arm-kernel, linux-kernel, linux-ide, dmaengine,
	linux-media, linux-mmc, linux-mtd, netdev, devel, alsa-devel

As the last driver using the former mechanism to acquire the DMA
requestor line has be converted to the dma_slave_map, remove all these
resources from the PXA devices.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
---
 arch/arm/mach-pxa/devices.c | 136 --------------------------------------------
 1 file changed, 136 deletions(-)

diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c
index da67ebe9a7d5..c0b3c90fd67f 100644
--- a/arch/arm/mach-pxa/devices.c
+++ b/arch/arm/mach-pxa/devices.c
@@ -61,16 +61,6 @@ static struct resource pxamci_resources[] = {
 		.end	= IRQ_MMC,
 		.flags	= IORESOURCE_IRQ,
 	},
-	[2] = {
-		.start	= 21,
-		.end	= 21,
-		.flags	= IORESOURCE_DMA,
-	},
-	[3] = {
-		.start	= 22,
-		.end	= 22,
-		.flags	= IORESOURCE_DMA,
-	},
 };
 
 static u64 pxamci_dmamask = 0xffffffffUL;
@@ -408,16 +398,6 @@ static struct resource pxa_ir_resources[] = {
 		.end	= 0x40700023,
 		.flags  = IORESOURCE_MEM,
 	},
-	[5] = {
-		.start  = 17,
-		.end	= 17,
-		.flags  = IORESOURCE_DMA,
-	},
-	[6] = {
-		.start  = 18,
-		.end	= 18,
-		.flags  = IORESOURCE_DMA,
-	},
 };
 
 struct platform_device pxa_device_ficp = {
@@ -546,18 +526,6 @@ static struct resource pxa25x_resource_ssp[] = {
 		.end	= IRQ_SSP,
 		.flags	= IORESOURCE_IRQ,
 	},
-	[2] = {
-		/* DRCMR for RX */
-		.start	= 13,
-		.end	= 13,
-		.flags	= IORESOURCE_DMA,
-	},
-	[3] = {
-		/* DRCMR for TX */
-		.start	= 14,
-		.end	= 14,
-		.flags	= IORESOURCE_DMA,
-	},
 };
 
 struct platform_device pxa25x_device_ssp = {
@@ -584,18 +552,6 @@ static struct resource pxa25x_resource_nssp[] = {
 		.end	= IRQ_NSSP,
 		.flags	= IORESOURCE_IRQ,
 	},
-	[2] = {
-		/* DRCMR for RX */
-		.start	= 15,
-		.end	= 15,
-		.flags	= IORESOURCE_DMA,
-	},
-	[3] = {
-		/* DRCMR for TX */
-		.start	= 16,
-		.end	= 16,
-		.flags	= IORESOURCE_DMA,
-	},
 };
 
 struct platform_device pxa25x_device_nssp = {
@@ -622,18 +578,6 @@ static struct resource pxa25x_resource_assp[] = {
 		.end	= IRQ_ASSP,
 		.flags	= IORESOURCE_IRQ,
 	},
-	[2] = {
-		/* DRCMR for RX */
-		.start	= 23,
-		.end	= 23,
-		.flags	= IORESOURCE_DMA,
-	},
-	[3] = {
-		/* DRCMR for TX */
-		.start	= 24,
-		.end	= 24,
-		.flags	= IORESOURCE_DMA,
-	},
 };
 
 struct platform_device pxa25x_device_assp = {
@@ -752,18 +696,6 @@ static struct resource pxa27x_resource_ssp1[] = {
 		.end	= IRQ_SSP,
 		.flags	= IORESOURCE_IRQ,
 	},
-	[2] = {
-		/* DRCMR for RX */
-		.start	= 13,
-		.end	= 13,
-		.flags	= IORESOURCE_DMA,
-	},
-	[3] = {
-		/* DRCMR for TX */
-		.start	= 14,
-		.end	= 14,
-		.flags	= IORESOURCE_DMA,
-	},
 };
 
 struct platform_device pxa27x_device_ssp1 = {
@@ -790,18 +722,6 @@ static struct resource pxa27x_resource_ssp2[] = {
 		.end	= IRQ_SSP2,
 		.flags	= IORESOURCE_IRQ,
 	},
-	[2] = {
-		/* DRCMR for RX */
-		.start	= 15,
-		.end	= 15,
-		.flags	= IORESOURCE_DMA,
-	},
-	[3] = {
-		/* DRCMR for TX */
-		.start	= 16,
-		.end	= 16,
-		.flags	= IORESOURCE_DMA,
-	},
 };
 
 struct platform_device pxa27x_device_ssp2 = {
@@ -828,18 +748,6 @@ static struct resource pxa27x_resource_ssp3[] = {
 		.end	= IRQ_SSP3,
 		.flags	= IORESOURCE_IRQ,
 	},
-	[2] = {
-		/* DRCMR for RX */
-		.start	= 66,
-		.end	= 66,
-		.flags	= IORESOURCE_DMA,
-	},
-	[3] = {
-		/* DRCMR for TX */
-		.start	= 67,
-		.end	= 67,
-		.flags	= IORESOURCE_DMA,
-	},
 };
 
 struct platform_device pxa27x_device_ssp3 = {
@@ -896,16 +804,6 @@ static struct resource pxa3xx_resources_mci2[] = {
 		.end	= IRQ_MMC2,
 		.flags	= IORESOURCE_IRQ,
 	},
-	[2] = {
-		.start	= 93,
-		.end	= 93,
-		.flags	= IORESOURCE_DMA,
-	},
-	[3] = {
-		.start	= 94,
-		.end	= 94,
-		.flags	= IORESOURCE_DMA,
-	},
 };
 
 struct platform_device pxa3xx_device_mci2 = {
@@ -935,16 +833,6 @@ static struct resource pxa3xx_resources_mci3[] = {
 		.end	= IRQ_MMC3,
 		.flags	= IORESOURCE_IRQ,
 	},
-	[2] = {
-		.start	= 100,
-		.end	= 100,
-		.flags	= IORESOURCE_DMA,
-	},
-	[3] = {
-		.start	= 101,
-		.end	= 101,
-		.flags	= IORESOURCE_DMA,
-	},
 };
 
 struct platform_device pxa3xx_device_mci3 = {
@@ -1022,18 +910,6 @@ static struct resource pxa3xx_resources_nand[] = {
 		.end	= IRQ_NAND,
 		.flags	= IORESOURCE_IRQ,
 	},
-	[2] = {
-		/* DRCMR for Data DMA */
-		.start	= 97,
-		.end	= 97,
-		.flags	= IORESOURCE_DMA,
-	},
-	[3] = {
-		/* DRCMR for Command DMA */
-		.start	= 99,
-		.end	= 99,
-		.flags	= IORESOURCE_DMA,
-	},
 };
 
 static u64 pxa3xx_nand_dma_mask = DMA_BIT_MASK(32);
@@ -1067,18 +943,6 @@ static struct resource pxa3xx_resource_ssp4[] = {
 		.end	= IRQ_SSP4,
 		.flags	= IORESOURCE_IRQ,
 	},
-	[2] = {
-		/* DRCMR for RX */
-		.start	= 2,
-		.end	= 2,
-		.flags	= IORESOURCE_DMA,
-	},
-	[3] = {
-		/* DRCMR for TX */
-		.start	= 3,
-		.end	= 3,
-		.flags	= IORESOURCE_DMA,
-	},
 };
 
 /*

^ permalink raw reply related	[flat|nested] 218+ messages in thread
* [15/15] ARM: pxa: change SSP DMA channels allocation
  2018-04-02 14:26 ` Robert Jarzmik
                   ` (2 preceding siblings ...)
  (?)
@ 2018-04-02 14:26 ` Robert Jarzmik
  -1 siblings, 0 replies; 218+ messages in thread
From: Robert Jarzmik @ 2018-04-02 14:26 UTC (permalink / raw)
  To: Daniel Mack, Haojian Zhuang, Robert Jarzmik,
	Bartlomiej Zolnierkiewicz, Tejun Heo, Vinod Koul,
	Mauro Carvalho Chehab, Ulf Hansson, Ezequiel Garcia,
	Boris Brezillon, David Woodhouse, Brian Norris, Marek Vasut,
	Richard Weinberger, Cyrille Pitchen, Nicolas Pitre, Samuel Ortiz,
	Greg Kroah-Hartman, Jaroslav Kysela, Takashi Iwai, Liam Girdwood,
	Mark Brown, Arnd Bergmann, Russell King, Jarkko Nikula
  Cc: linux-arm-kernel, linux-kernel, linux-ide, dmaengine,
	linux-media, linux-mmc, linux-mtd, netdev, devel, alsa-devel

Now the dma_slave_map is available for PXA architecture, switch the SSP
device to it.

This specifically means that :
- for platform data based machines, the DMA requestor channels are
  extracted from platform data and passed further to the SSP user,
  ie. usually the pxa-pcm-audio driver

- for device tree platforms, the dma node should be hooked into the
  pxa-pcm-audio node.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
---
 arch/arm/plat-pxa/ssp.c    | 50 +++++-----------------------------------------
 include/linux/pxa2xx_ssp.h |  4 ++--
 sound/soc/pxa/pxa-ssp.c    |  5 ++---
 3 files changed, 9 insertions(+), 50 deletions(-)

diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c
index ba13f793fbce..3457f01e3340 100644
--- a/arch/arm/plat-pxa/ssp.c
+++ b/arch/arm/plat-pxa/ssp.c
@@ -16,6 +16,7 @@
  *  Author: Liam Girdwood <liam.girdwood@wolfsonmicro.com>
  */
 
+#include <mach/audio.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -116,6 +117,7 @@ static int pxa_ssp_probe(struct platform_device *pdev)
 	struct resource *res;
 	struct ssp_device *ssp;
 	struct device *dev = &pdev->dev;
+	struct pxa_ssp_info *info = dev_get_platdata(dev);
 
 	ssp = devm_kzalloc(dev, sizeof(struct ssp_device), GFP_KERNEL);
 	if (ssp == NULL)
@@ -127,51 +129,9 @@ static int pxa_ssp_probe(struct platform_device *pdev)
 	if (IS_ERR(ssp->clk))
 		return PTR_ERR(ssp->clk);
 
-	if (dev->of_node) {
-		struct of_phandle_args dma_spec;
-		struct device_node *np = dev->of_node;
-		int ret;
-
-		/*
-		 * FIXME: we should allocate the DMA channel from this
-		 * context and pass the channel down to the ssp users.
-		 * For now, we lookup the rx and tx indices manually
-		 */
-
-		/* rx */
-		ret = of_parse_phandle_with_args(np, "dmas", "#dma-cells",
-						 0, &dma_spec);
-
-		if (ret) {
-			dev_err(dev, "Can't parse dmas property\n");
-			return -ENODEV;
-		}
-		ssp->drcmr_rx = dma_spec.args[0];
-		of_node_put(dma_spec.np);
-
-		/* tx */
-		ret = of_parse_phandle_with_args(np, "dmas", "#dma-cells",
-						 1, &dma_spec);
-		if (ret) {
-			dev_err(dev, "Can't parse dmas property\n");
-			return -ENODEV;
-		}
-		ssp->drcmr_tx = dma_spec.args[0];
-		of_node_put(dma_spec.np);
-	} else {
-		res = platform_get_resource(pdev, IORESOURCE_DMA, 0);
-		if (res == NULL) {
-			dev_err(dev, "no SSP RX DRCMR defined\n");
-			return -ENODEV;
-		}
-		ssp->drcmr_rx = res->start;
-
-		res = platform_get_resource(pdev, IORESOURCE_DMA, 1);
-		if (res == NULL) {
-			dev_err(dev, "no SSP TX DRCMR defined\n");
-			return -ENODEV;
-		}
-		ssp->drcmr_tx = res->start;
+	if (!dev->of_node && info) {
+		ssp->dma_chan_rx = info->dma_chan_rx_name;
+		ssp->dma_chan_tx = info->dma_chan_tx_name;
 	}
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
diff --git a/include/linux/pxa2xx_ssp.h b/include/linux/pxa2xx_ssp.h
index 8461b18e4608..99c99d397e4d 100644
--- a/include/linux/pxa2xx_ssp.h
+++ b/include/linux/pxa2xx_ssp.h
@@ -212,9 +212,9 @@ struct ssp_device {
 	int		type;
 	int		use_count;
 	int		irq;
-	int		drcmr_rx;
-	int		drcmr_tx;
 
+	const char	*dma_chan_rx;
+	const char	*dma_chan_tx;
 	struct device_node	*of_node;
 };
 
diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c
index 0291c7cb64eb..a0189b88f1d2 100644
--- a/sound/soc/pxa/pxa-ssp.c
+++ b/sound/soc/pxa/pxa-ssp.c
@@ -104,9 +104,8 @@ static int pxa_ssp_startup(struct snd_pcm_substream *substream,
 	dma = kzalloc(sizeof(struct snd_dmaengine_dai_dma_data), GFP_KERNEL);
 	if (!dma)
 		return -ENOMEM;
-
-	dma->filter_data = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ?
-				&ssp->drcmr_tx : &ssp->drcmr_rx;
+	dma->chan_name = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ?
+		ssp->dma_chan_tx : ssp->dma_chan_rx;
 
 	snd_soc_dai_set_dma_data(cpu_dai, substream, dma);
 

^ permalink raw reply related	[flat|nested] 218+ messages in thread
* [12/15] dmaengine: pxa: make the filter function internal
  2018-04-02 14:26 ` Robert Jarzmik
                   ` (2 preceding siblings ...)
  (?)
@ 2018-04-02 16:25 ` kbuild test robot
  -1 siblings, 0 replies; 218+ messages in thread
From: kbuild test robot @ 2018-04-02 16:25 UTC (permalink / raw)
  To: Robert Jarzmik
  Cc: kbuild-all, Daniel Mack, Haojian Zhuang,
	Bartlomiej Zolnierkiewicz, Tejun Heo, Vinod Koul,
	Mauro Carvalho Chehab, Ulf Hansson, Ezequiel Garcia,
	Boris Brezillon, David Woodhouse, Brian Norris, Marek Vasut,
	Richard Weinberger, Cyrille Pitchen, Nicolas Pitre, Samuel Ortiz,
	Greg Kroah-Hartman, Jaroslav Kysela, Takashi Iwai, Liam Girdwood,
	Mark Brown, Arnd Bergmann, Thomas Gleixner, Philippe Ombredanne,
	Kate Stewart, linux-arm-kernel, linux-kernel, linux-ide,
	dmaengine, linux-media, linux-mmc, linux-mtd, netdev, devel,
	alsa-devel

Hi Robert,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v4.16]
[cannot apply to arm-soc/for-next next-20180329]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Robert-Jarzmik/ARM-pxa-switch-to-DMA-slave-maps/20180402-233029
config: i386-allmodconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   In file included from drivers/mtd/nand/marvell_nand.c:21:0:
   drivers/mtd/nand/marvell_nand.c: In function 'marvell_nfc_init_dma':
>> drivers/mtd/nand/marvell_nand.c:2621:42: error: 'pxad_filter_fn' undeclared (first use in this function); did you mean 'dma_filter_fn'?
      dma_request_slave_channel_compat(mask, pxad_filter_fn,
                                             ^
   include/linux/dmaengine.h:1408:46: note: in definition of macro 'dma_request_slave_channel_compat'
     __dma_request_slave_channel_compat(&(mask), x, y, dev, name)
                                                 ^
   drivers/mtd/nand/marvell_nand.c:2621:42: note: each undeclared identifier is reported only once for each function it appears in
      dma_request_slave_channel_compat(mask, pxad_filter_fn,
                                             ^
   include/linux/dmaengine.h:1408:46: note: in definition of macro 'dma_request_slave_channel_compat'
     __dma_request_slave_channel_compat(&(mask), x, y, dev, name)
                                                 ^

vim +2621 drivers/mtd/nand/marvell_nand.c

02f26ecf Miquel Raynal 2018-01-09  2588  
02f26ecf Miquel Raynal 2018-01-09  2589  static int marvell_nfc_init_dma(struct marvell_nfc *nfc)
02f26ecf Miquel Raynal 2018-01-09  2590  {
02f26ecf Miquel Raynal 2018-01-09  2591  	struct platform_device *pdev = container_of(nfc->dev,
02f26ecf Miquel Raynal 2018-01-09  2592  						    struct platform_device,
02f26ecf Miquel Raynal 2018-01-09  2593  						    dev);
02f26ecf Miquel Raynal 2018-01-09  2594  	struct dma_slave_config config = {};
02f26ecf Miquel Raynal 2018-01-09  2595  	struct resource *r;
02f26ecf Miquel Raynal 2018-01-09  2596  	dma_cap_mask_t mask;
02f26ecf Miquel Raynal 2018-01-09  2597  	struct pxad_param param;
02f26ecf Miquel Raynal 2018-01-09  2598  	int ret;
02f26ecf Miquel Raynal 2018-01-09  2599  
02f26ecf Miquel Raynal 2018-01-09  2600  	if (!IS_ENABLED(CONFIG_PXA_DMA)) {
02f26ecf Miquel Raynal 2018-01-09  2601  		dev_warn(nfc->dev,
02f26ecf Miquel Raynal 2018-01-09  2602  			 "DMA not enabled in configuration\n");
02f26ecf Miquel Raynal 2018-01-09  2603  		return -ENOTSUPP;
02f26ecf Miquel Raynal 2018-01-09  2604  	}
02f26ecf Miquel Raynal 2018-01-09  2605  
02f26ecf Miquel Raynal 2018-01-09  2606  	ret = dma_set_mask_and_coherent(nfc->dev, DMA_BIT_MASK(32));
02f26ecf Miquel Raynal 2018-01-09  2607  	if (ret)
02f26ecf Miquel Raynal 2018-01-09  2608  		return ret;
02f26ecf Miquel Raynal 2018-01-09  2609  
02f26ecf Miquel Raynal 2018-01-09  2610  	r = platform_get_resource(pdev, IORESOURCE_DMA, 0);
02f26ecf Miquel Raynal 2018-01-09  2611  	if (!r) {
02f26ecf Miquel Raynal 2018-01-09  2612  		dev_err(nfc->dev, "No resource defined for data DMA\n");
02f26ecf Miquel Raynal 2018-01-09  2613  		return -ENXIO;
02f26ecf Miquel Raynal 2018-01-09  2614  	}
02f26ecf Miquel Raynal 2018-01-09  2615  
02f26ecf Miquel Raynal 2018-01-09  2616  	param.drcmr = r->start;
02f26ecf Miquel Raynal 2018-01-09  2617  	param.prio = PXAD_PRIO_LOWEST;
02f26ecf Miquel Raynal 2018-01-09  2618  	dma_cap_zero(mask);
02f26ecf Miquel Raynal 2018-01-09  2619  	dma_cap_set(DMA_SLAVE, mask);
02f26ecf Miquel Raynal 2018-01-09  2620  	nfc->dma_chan =
02f26ecf Miquel Raynal 2018-01-09 @2621  		dma_request_slave_channel_compat(mask, pxad_filter_fn,
02f26ecf Miquel Raynal 2018-01-09  2622  						 &param, nfc->dev,
02f26ecf Miquel Raynal 2018-01-09  2623  						 "data");
02f26ecf Miquel Raynal 2018-01-09  2624  	if (!nfc->dma_chan) {
02f26ecf Miquel Raynal 2018-01-09  2625  		dev_err(nfc->dev,
02f26ecf Miquel Raynal 2018-01-09  2626  			"Unable to request data DMA channel\n");
02f26ecf Miquel Raynal 2018-01-09  2627  		return -ENODEV;
02f26ecf Miquel Raynal 2018-01-09  2628  	}
02f26ecf Miquel Raynal 2018-01-09  2629  
02f26ecf Miquel Raynal 2018-01-09  2630  	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
02f26ecf Miquel Raynal 2018-01-09  2631  	if (!r)
02f26ecf Miquel Raynal 2018-01-09  2632  		return -ENXIO;
02f26ecf Miquel Raynal 2018-01-09  2633  
02f26ecf Miquel Raynal 2018-01-09  2634  	config.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
02f26ecf Miquel Raynal 2018-01-09  2635  	config.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
02f26ecf Miquel Raynal 2018-01-09  2636  	config.src_addr = r->start + NDDB;
02f26ecf Miquel Raynal 2018-01-09  2637  	config.dst_addr = r->start + NDDB;
02f26ecf Miquel Raynal 2018-01-09  2638  	config.src_maxburst = 32;
02f26ecf Miquel Raynal 2018-01-09  2639  	config.dst_maxburst = 32;
02f26ecf Miquel Raynal 2018-01-09  2640  	ret = dmaengine_slave_config(nfc->dma_chan, &config);
02f26ecf Miquel Raynal 2018-01-09  2641  	if (ret < 0) {
02f26ecf Miquel Raynal 2018-01-09  2642  		dev_err(nfc->dev, "Failed to configure DMA channel\n");
02f26ecf Miquel Raynal 2018-01-09  2643  		return ret;
02f26ecf Miquel Raynal 2018-01-09  2644  	}
02f26ecf Miquel Raynal 2018-01-09  2645  
02f26ecf Miquel Raynal 2018-01-09  2646  	/*
02f26ecf Miquel Raynal 2018-01-09  2647  	 * DMA must act on length multiple of 32 and this length may be
02f26ecf Miquel Raynal 2018-01-09  2648  	 * bigger than the destination buffer. Use this buffer instead
02f26ecf Miquel Raynal 2018-01-09  2649  	 * for DMA transfers and then copy the desired amount of data to
02f26ecf Miquel Raynal 2018-01-09  2650  	 * the provided buffer.
02f26ecf Miquel Raynal 2018-01-09  2651  	 */
c495a927 Miquel Raynal 2018-01-19  2652  	nfc->dma_buf = kmalloc(MAX_CHUNK_SIZE, GFP_KERNEL | GFP_DMA);
02f26ecf Miquel Raynal 2018-01-09  2653  	if (!nfc->dma_buf)
02f26ecf Miquel Raynal 2018-01-09  2654  		return -ENOMEM;
02f26ecf Miquel Raynal 2018-01-09  2655  
02f26ecf Miquel Raynal 2018-01-09  2656  	nfc->use_dma = true;
02f26ecf Miquel Raynal 2018-01-09  2657  
02f26ecf Miquel Raynal 2018-01-09  2658  	return 0;
02f26ecf Miquel Raynal 2018-01-09  2659  }
02f26ecf Miquel Raynal 2018-01-09  2660  

:::::: The code at line 2621 was first introduced by commit
:::::: 02f26ecf8c772751d4b24744d487f6b1b20e75d4 mtd: nand: add reworked Marvell NAND controller driver

:::::: TO: Miquel Raynal <miquel.raynal@free-electrons.com>
:::::: CC: Boris Brezillon <boris.brezillon@free-electrons.com>
---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

^ permalink raw reply	[flat|nested] 218+ messages in thread
* [12/15] dmaengine: pxa: make the filter function internal
  2018-04-02 14:26 ` Robert Jarzmik
                   ` (3 preceding siblings ...)
  (?)
@ 2018-04-02 16:35 ` kbuild test robot
  -1 siblings, 0 replies; 218+ messages in thread
From: kbuild test robot @ 2018-04-02 16:35 UTC (permalink / raw)
  To: Robert Jarzmik
  Cc: kbuild-all, Daniel Mack, Haojian Zhuang,
	Bartlomiej Zolnierkiewicz, Tejun Heo, Vinod Koul,
	Mauro Carvalho Chehab, Ulf Hansson, Ezequiel Garcia,
	Boris Brezillon, David Woodhouse, Brian Norris, Marek Vasut,
	Richard Weinberger, Cyrille Pitchen, Nicolas Pitre, Samuel Ortiz,
	Greg Kroah-Hartman, Jaroslav Kysela, Takashi Iwai, Liam Girdwood,
	Mark Brown, Arnd Bergmann, Thomas Gleixner, Philippe Ombredanne,
	Kate Stewart, linux-arm-kernel, linux-kernel, linux-ide,
	dmaengine, linux-media, linux-mmc, linux-mtd, netdev, devel,
	alsa-devel

Hi Robert,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v4.16]
[cannot apply to arm-soc/for-next next-20180329]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Robert-Jarzmik/ARM-pxa-switch-to-DMA-slave-maps/20180402-233029
reproduce:
        # apt-get install sparse
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

   drivers/mtd/nand/marvell_nand.c:2621:17: sparse: undefined identifier 'pxad_filter_fn'
>> drivers/mtd/nand/marvell_nand.c:2621:17: sparse: call with no type!
   In file included from drivers/mtd/nand/marvell_nand.c:21:0:
   drivers/mtd/nand/marvell_nand.c: In function 'marvell_nfc_init_dma':
   drivers/mtd/nand/marvell_nand.c:2621:42: error: 'pxad_filter_fn' undeclared (first use in this function); did you mean 'dma_filter_fn'?
      dma_request_slave_channel_compat(mask, pxad_filter_fn,
                                             ^
   include/linux/dmaengine.h:1408:46: note: in definition of macro 'dma_request_slave_channel_compat'
     __dma_request_slave_channel_compat(&(mask), x, y, dev, name)
                                                 ^
   drivers/mtd/nand/marvell_nand.c:2621:42: note: each undeclared identifier is reported only once for each function it appears in
      dma_request_slave_channel_compat(mask, pxad_filter_fn,
                                             ^
   include/linux/dmaengine.h:1408:46: note: in definition of macro 'dma_request_slave_channel_compat'
     __dma_request_slave_channel_compat(&(mask), x, y, dev, name)
                                                 ^

vim +2621 drivers/mtd/nand/marvell_nand.c

02f26ecf Miquel Raynal 2018-01-09  2588  
02f26ecf Miquel Raynal 2018-01-09  2589  static int marvell_nfc_init_dma(struct marvell_nfc *nfc)
02f26ecf Miquel Raynal 2018-01-09  2590  {
02f26ecf Miquel Raynal 2018-01-09  2591  	struct platform_device *pdev = container_of(nfc->dev,
02f26ecf Miquel Raynal 2018-01-09  2592  						    struct platform_device,
02f26ecf Miquel Raynal 2018-01-09  2593  						    dev);
02f26ecf Miquel Raynal 2018-01-09  2594  	struct dma_slave_config config = {};
02f26ecf Miquel Raynal 2018-01-09  2595  	struct resource *r;
02f26ecf Miquel Raynal 2018-01-09  2596  	dma_cap_mask_t mask;
02f26ecf Miquel Raynal 2018-01-09  2597  	struct pxad_param param;
02f26ecf Miquel Raynal 2018-01-09  2598  	int ret;
02f26ecf Miquel Raynal 2018-01-09  2599  
02f26ecf Miquel Raynal 2018-01-09  2600  	if (!IS_ENABLED(CONFIG_PXA_DMA)) {
02f26ecf Miquel Raynal 2018-01-09  2601  		dev_warn(nfc->dev,
02f26ecf Miquel Raynal 2018-01-09  2602  			 "DMA not enabled in configuration\n");
02f26ecf Miquel Raynal 2018-01-09  2603  		return -ENOTSUPP;
02f26ecf Miquel Raynal 2018-01-09  2604  	}
02f26ecf Miquel Raynal 2018-01-09  2605  
02f26ecf Miquel Raynal 2018-01-09  2606  	ret = dma_set_mask_and_coherent(nfc->dev, DMA_BIT_MASK(32));
02f26ecf Miquel Raynal 2018-01-09  2607  	if (ret)
02f26ecf Miquel Raynal 2018-01-09  2608  		return ret;
02f26ecf Miquel Raynal 2018-01-09  2609  
02f26ecf Miquel Raynal 2018-01-09  2610  	r = platform_get_resource(pdev, IORESOURCE_DMA, 0);
02f26ecf Miquel Raynal 2018-01-09  2611  	if (!r) {
02f26ecf Miquel Raynal 2018-01-09  2612  		dev_err(nfc->dev, "No resource defined for data DMA\n");
02f26ecf Miquel Raynal 2018-01-09  2613  		return -ENXIO;
02f26ecf Miquel Raynal 2018-01-09  2614  	}
02f26ecf Miquel Raynal 2018-01-09  2615  
02f26ecf Miquel Raynal 2018-01-09  2616  	param.drcmr = r->start;
02f26ecf Miquel Raynal 2018-01-09  2617  	param.prio = PXAD_PRIO_LOWEST;
02f26ecf Miquel Raynal 2018-01-09  2618  	dma_cap_zero(mask);
02f26ecf Miquel Raynal 2018-01-09  2619  	dma_cap_set(DMA_SLAVE, mask);
02f26ecf Miquel Raynal 2018-01-09  2620  	nfc->dma_chan =
02f26ecf Miquel Raynal 2018-01-09 @2621  		dma_request_slave_channel_compat(mask, pxad_filter_fn,
02f26ecf Miquel Raynal 2018-01-09  2622  						 &param, nfc->dev,
02f26ecf Miquel Raynal 2018-01-09  2623  						 "data");
02f26ecf Miquel Raynal 2018-01-09  2624  	if (!nfc->dma_chan) {
02f26ecf Miquel Raynal 2018-01-09  2625  		dev_err(nfc->dev,
02f26ecf Miquel Raynal 2018-01-09  2626  			"Unable to request data DMA channel\n");
02f26ecf Miquel Raynal 2018-01-09  2627  		return -ENODEV;
02f26ecf Miquel Raynal 2018-01-09  2628  	}
02f26ecf Miquel Raynal 2018-01-09  2629  
02f26ecf Miquel Raynal 2018-01-09  2630  	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
02f26ecf Miquel Raynal 2018-01-09  2631  	if (!r)
02f26ecf Miquel Raynal 2018-01-09  2632  		return -ENXIO;
02f26ecf Miquel Raynal 2018-01-09  2633  
02f26ecf Miquel Raynal 2018-01-09  2634  	config.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
02f26ecf Miquel Raynal 2018-01-09  2635  	config.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
02f26ecf Miquel Raynal 2018-01-09  2636  	config.src_addr = r->start + NDDB;
02f26ecf Miquel Raynal 2018-01-09  2637  	config.dst_addr = r->start + NDDB;
02f26ecf Miquel Raynal 2018-01-09  2638  	config.src_maxburst = 32;
02f26ecf Miquel Raynal 2018-01-09  2639  	config.dst_maxburst = 32;
02f26ecf Miquel Raynal 2018-01-09  2640  	ret = dmaengine_slave_config(nfc->dma_chan, &config);
02f26ecf Miquel Raynal 2018-01-09  2641  	if (ret < 0) {
02f26ecf Miquel Raynal 2018-01-09  2642  		dev_err(nfc->dev, "Failed to configure DMA channel\n");
02f26ecf Miquel Raynal 2018-01-09  2643  		return ret;
02f26ecf Miquel Raynal 2018-01-09  2644  	}
02f26ecf Miquel Raynal 2018-01-09  2645  
02f26ecf Miquel Raynal 2018-01-09  2646  	/*
02f26ecf Miquel Raynal 2018-01-09  2647  	 * DMA must act on length multiple of 32 and this length may be
02f26ecf Miquel Raynal 2018-01-09  2648  	 * bigger than the destination buffer. Use this buffer instead
02f26ecf Miquel Raynal 2018-01-09  2649  	 * for DMA transfers and then copy the desired amount of data to
02f26ecf Miquel Raynal 2018-01-09  2650  	 * the provided buffer.
02f26ecf Miquel Raynal 2018-01-09  2651  	 */
c495a927 Miquel Raynal 2018-01-19  2652  	nfc->dma_buf = kmalloc(MAX_CHUNK_SIZE, GFP_KERNEL | GFP_DMA);
02f26ecf Miquel Raynal 2018-01-09  2653  	if (!nfc->dma_buf)
02f26ecf Miquel Raynal 2018-01-09  2654  		return -ENOMEM;
02f26ecf Miquel Raynal 2018-01-09  2655  
02f26ecf Miquel Raynal 2018-01-09  2656  	nfc->use_dma = true;
02f26ecf Miquel Raynal 2018-01-09  2657  
02f26ecf Miquel Raynal 2018-01-09  2658  	return 0;
02f26ecf Miquel Raynal 2018-01-09  2659  }
02f26ecf Miquel Raynal 2018-01-09  2660  

:::::: The code at line 2621 was first introduced by commit
:::::: 02f26ecf8c772751d4b24744d487f6b1b20e75d4 mtd: nand: add reworked Marvell NAND controller driver

:::::: TO: Miquel Raynal <miquel.raynal@free-electrons.com>
:::::: CC: Boris Brezillon <boris.brezillon@free-electrons.com>
---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
--
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

^ permalink raw reply	[flat|nested] 218+ messages in thread
* [15/15] ARM: pxa: change SSP DMA channels allocation
  2018-04-02 14:26 ` Robert Jarzmik
                   ` (2 preceding siblings ...)
  (?)
@ 2018-04-02 18:46 ` kbuild test robot
  -1 siblings, 0 replies; 218+ messages in thread
From: kbuild test robot @ 2018-04-02 18:46 UTC (permalink / raw)
  To: Robert Jarzmik
  Cc: kbuild-all, Daniel Mack, Haojian Zhuang,
	Bartlomiej Zolnierkiewicz, Tejun Heo, Vinod Koul,
	Mauro Carvalho Chehab, Ulf Hansson, Ezequiel Garcia,
	Boris Brezillon, David Woodhouse, Brian Norris, Marek Vasut,
	Richard Weinberger, Cyrille Pitchen, Nicolas Pitre, Samuel Ortiz,
	Greg Kroah-Hartman, Jaroslav Kysela, Takashi Iwai, Liam Girdwood,
	Mark Brown, Arnd Bergmann, Russell King, Jarkko Nikula,
	linux-arm-kernel, linux-kernel, linux-ide, dmaengine,
	linux-media, linux-mmc, linux-mtd, netdev, devel, alsa-devel

Hi Robert,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v4.16]
[cannot apply to arm-soc/for-next next-20180329]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Robert-Jarzmik/ARM-pxa-switch-to-DMA-slave-maps/20180402-233029
config: arm-allmodconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=arm 

All errors (new ones prefixed by >>):

>> arch/arm/plat-pxa/ssp.c:19:10: fatal error: mach/audio.h: No such file or directory
    #include <mach/audio.h>
             ^~~~~~~~~~~~~~
   compilation terminated.

vim +19 arch/arm/plat-pxa/ssp.c

  > 19	#include <mach/audio.h>
    20	#include <linux/module.h>
    21	#include <linux/kernel.h>
    22	#include <linux/sched.h>
    23	#include <linux/slab.h>
    24	#include <linux/errno.h>
    25	#include <linux/interrupt.h>
    26	#include <linux/ioport.h>
    27	#include <linux/init.h>
    28	#include <linux/mutex.h>
    29	#include <linux/clk.h>
    30	#include <linux/err.h>
    31	#include <linux/platform_device.h>
    32	#include <linux/spi/pxa2xx_spi.h>
    33	#include <linux/io.h>
    34	#include <linux/of.h>
    35	#include <linux/of_device.h>
    36
---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

^ permalink raw reply	[flat|nested] 218+ messages in thread
* [02/15] ARM: pxa: add dma slave map
  2018-04-02 14:26 ` Robert Jarzmik
                   ` (3 preceding siblings ...)
  (?)
@ 2018-04-03  6:51 ` Arnd Bergmann
  -1 siblings, 0 replies; 218+ messages in thread
From: Arnd Bergmann @ 2018-04-03  6:51 UTC (permalink / raw)
  To: Robert Jarzmik
  Cc: Daniel Mack, Haojian Zhuang, Bartlomiej Zolnierkiewicz,
	Tejun Heo, Vinod Koul, Mauro Carvalho Chehab, Ulf Hansson,
	Ezequiel Garcia, Boris Brezillon, David Woodhouse, Brian Norris,
	Marek Vasut, Richard Weinberger, Cyrille Pitchen, Nicolas Pitre,
	Samuel Ortiz, Greg Kroah-Hartman, Jaroslav Kysela, Takashi Iwai,
	Liam Girdwood, Mark Brown, Russell King, Linux ARM,
	Linux Kernel Mailing List, IDE-ML, dmaengine,
	Linux Media Mailing List, linux-mmc, linux-mtd, Networking,
	devel, alsa-devel

On Mon, Apr 2, 2018 at 4:26 PM, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
> +
> +static const struct dma_slave_map pxa_slave_map[] = {
> +       /* PXA25x, PXA27x and PXA3xx common entries */
> +       { "pxa-pcm-audio", "ac97_mic_mono", PDMA_FILTER_PARAM(LOWEST, 8) },
> +       { "pxa-pcm-audio", "ac97_aux_mono_in", PDMA_FILTER_PARAM(LOWEST, 9) },
> +       { "pxa-pcm-audio", "ac97_aux_mono_out", PDMA_FILTER_PARAM(LOWEST, 10) },
> +       { "pxa-pcm-audio", "ac97_stereo_in", PDMA_FILTER_PARAM(LOWEST, 11) },
> +       { "pxa-pcm-audio", "ac97_stereo_out", PDMA_FILTER_PARAM(LOWEST, 12) },
> +       { "pxa-pcm-audio", "ssp1_rx", PDMA_FILTER_PARAM(LOWEST, 13) },
> +       { "pxa-pcm-audio", "ssp1_tx", PDMA_FILTER_PARAM(LOWEST, 14) },
> +       { "pxa-pcm-audio", "ssp2_rx", PDMA_FILTER_PARAM(LOWEST, 15) },
> +       { "pxa-pcm-audio", "ssp2_tx", PDMA_FILTER_PARAM(LOWEST, 16) },
> +       { "pxa2xx-ir", "rx", PDMA_FILTER_PARAM(LOWEST, 17) },
> +       { "pxa2xx-ir", "tx", PDMA_FILTER_PARAM(LOWEST, 18) },
> +       { "pxa2xx-mci.0", "rx", PDMA_FILTER_PARAM(LOWEST, 21) },
> +       { "pxa2xx-mci.0", "tx", PDMA_FILTER_PARAM(LOWEST, 22) },


> +       { "smc911x.0", "rx", PDMA_FILTER_PARAM(LOWEST, -1) },
> +       { "smc911x.0", "tx", PDMA_FILTER_PARAM(LOWEST, -1) },
> +       { "smc91x.0", "data", PDMA_FILTER_PARAM(LOWEST, -1) },

This one is interesting, as you are dealing with an off-chip device,
and the channel number is '-'1. How does this even work? Does it
mean

> +       /* PXA25x specific map */
> +       { "pxa25x-ssp.0", "rx", PDMA_FILTER_PARAM(LOWEST, 13) },
> +       { "pxa25x-ssp.0", "tx", PDMA_FILTER_PARAM(LOWEST, 14) },
> +       { "pxa25x-nssp.1", "rx", PDMA_FILTER_PARAM(LOWEST, 15) },
> +       { "pxa25x-nssp.1", "tx", PDMA_FILTER_PARAM(LOWEST, 16) },
> +       { "pxa25x-nssp.2", "rx", PDMA_FILTER_PARAM(LOWEST, 23) },
> +       { "pxa25x-nssp.2", "tx", PDMA_FILTER_PARAM(LOWEST, 24) },
> +       { "pxa-pcm-audio", "nssp2_rx", PDMA_FILTER_PARAM(LOWEST, 15) },
> +       { "pxa-pcm-audio", "nssp2_tx", PDMA_FILTER_PARAM(LOWEST, 16) },
> +       { "pxa-pcm-audio", "nssp3_rx", PDMA_FILTER_PARAM(LOWEST, 23) },
> +       { "pxa-pcm-audio", "nssp3_tx", PDMA_FILTER_PARAM(LOWEST, 24) },
> +
> +       /* PXA27x specific map */
> +       { "pxa-pcm-audio", "ssp3_rx", PDMA_FILTER_PARAM(LOWEST, 66) },
> +       { "pxa-pcm-audio", "ssp3_tx", PDMA_FILTER_PARAM(LOWEST, 67) },
> +       { "pxa27x-camera.0", "CI_Y", PDMA_FILTER_PARAM(HIGHEST, 68) },
> +       { "pxa27x-camera.0", "CI_U", PDMA_FILTER_PARAM(HIGHEST, 69) },
> +       { "pxa27x-camera.0", "CI_V", PDMA_FILTER_PARAM(HIGHEST, 70) },
> +
> +       /* PXA3xx specific map */
> +       { "pxa-pcm-audio", "ssp4_rx", PDMA_FILTER_PARAM(LOWEST, 2) },
> +       { "pxa-pcm-audio", "ssp4_tx", PDMA_FILTER_PARAM(LOWEST, 3) },
> +       { "pxa2xx-mci.1", "rx", PDMA_FILTER_PARAM(LOWEST, 93) },
> +       { "pxa2xx-mci.1", "tx", PDMA_FILTER_PARAM(LOWEST, 94) },
> +       { "pxa3xx-nand", "data", PDMA_FILTER_PARAM(LOWEST, 97) },
> +       { "pxa2xx-mci.2", "rx", PDMA_FILTER_PARAM(LOWEST, 100) },
> +       { "pxa2xx-mci.2", "tx", PDMA_FILTER_PARAM(LOWEST, 101) },
> +};

Since more than half the entries in here are chip specific, maybe it would be
better to split that table into three and have a copy for each one in
arch/arm/mach-pxa/pxa{25x.27x.3xx}.c? Does that mean it's actually
a memory-to-memory transfer with a device being on the external
SRAM interface?

       Arnd
---
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

^ permalink raw reply	[flat|nested] 218+ messages in thread
* [12/15] dmaengine: pxa: make the filter function internal
  2018-04-02 16:35 ` kbuild test robot
                   ` (3 preceding siblings ...)
  (?)
@ 2018-04-03  7:13 ` Arnd Bergmann
  -1 siblings, 0 replies; 218+ messages in thread
From: Arnd Bergmann @ 2018-04-03  7:13 UTC (permalink / raw)
  To: kbuild test robot
  Cc: Robert Jarzmik, kbuild-all, Daniel Mack, Haojian Zhuang,
	Bartlomiej Zolnierkiewicz, Tejun Heo, Vinod Koul,
	Mauro Carvalho Chehab, Ulf Hansson, Ezequiel Garcia,
	Boris Brezillon, David Woodhouse, Brian Norris, Marek Vasut,
	Richard Weinberger, Cyrille Pitchen, Nicolas Pitre, Samuel Ortiz,
	Greg Kroah-Hartman, Jaroslav Kysela, Takashi Iwai, Liam Girdwood,
	Mark Brown, Thomas Gleixner, Philippe Ombredanne, Kate Stewart,
	Linux ARM, Linux Kernel Mailing List, IDE-ML, dmaengine,
	Linux Media Mailing List, linux-mmc, linux-mtd, Networking,
	devel, alsa-devel

On Mon, Apr 2, 2018 at 6:35 PM, kbuild test robot <lkp@intel.com> wrote:

>
>    drivers/mtd/nand/marvell_nand.c:2621:17: sparse: undefined identifier 'pxad_filter_fn'
>>> drivers/mtd/nand/marvell_nand.c:2621:17: sparse: call with no type!
>    In file included from drivers/mtd/nand/marvell_nand.c:21:0:
>    drivers/mtd/nand/marvell_nand.c: In function 'marvell_nfc_init_dma':
>    drivers/mtd/nand/marvell_nand.c:2621:42: error: 'pxad_filter_fn' undeclared (first use in this function); did you mean 'dma_filter_fn'?
>       dma_request_slave_channel_compat(mask, pxad_filter_fn,
>                                              ^
>    include/linux/dmaengine.h:1408:46: note: in definition of macro 'dma_request_slave_channel_compat'
>      __dma_request_slave_channel_compat(&(mask), x, y, dev, name)
>                                                  ^
>    drivers/mtd/nand/marvell_nand.c:2621:42: note: each undeclared identifier is reported only once for each function it appears in
>       dma_request_slave_channel_compat(mask, pxad_filter_fn,
>                                              ^
>    include/linux/dmaengine.h:1408:46: note: in definition of macro 'dma_request_slave_channel_compat'
>      __dma_request_slave_channel_compat(&(mask), x, y, dev, name)

The driver is a replacement for the pxa3xx nand driver, so it now has
to get changed as well.

       Arnd
---
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

^ permalink raw reply	[flat|nested] 218+ messages in thread
* [02/15] ARM: pxa: add dma slave map
  2018-04-03  6:51 ` Arnd Bergmann
                   ` (2 preceding siblings ...)
  (?)
@ 2018-04-03 15:18 ` Robert Jarzmik
  -1 siblings, 0 replies; 218+ messages in thread
From: Robert Jarzmik @ 2018-04-03 15:18 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Daniel Mack, Haojian Zhuang, Bartlomiej Zolnierkiewicz,
	Tejun Heo, Vinod Koul, Mauro Carvalho Chehab, Ulf Hansson,
	Ezequiel Garcia, Boris Brezillon, David Woodhouse, Brian Norris,
	Marek Vasut, Richard Weinberger, Cyrille Pitchen, Nicolas Pitre,
	Samuel Ortiz, Greg Kroah-Hartman, Jaroslav Kysela, Takashi Iwai,
	Liam Girdwood, Mark Brown, Russell King, Linux ARM,
	Linux Kernel Mailing List, IDE-ML, dmaengine,
	Linux Media Mailing List, linux-mmc, linux-mtd, Networking,
	devel, alsa-devel

Arnd Bergmann <arnd@arndb.de> writes:

>> +       { "smc911x.0", "rx", PDMA_FILTER_PARAM(LOWEST, -1) },
>> +       { "smc911x.0", "tx", PDMA_FILTER_PARAM(LOWEST, -1) },
>> +       { "smc91x.0", "data", PDMA_FILTER_PARAM(LOWEST, -1) },
>
> This one is interesting, as you are dealing with an off-chip device,
> and the channel number is '-'1. How does this even work? Does it
> mean

This relies on pxa_dma, in which the "-1" for a requestor line means "no
requestor" or said in another way "always requesting". As a consequence, as soon
as the DMA descriptors are queued, the transfer begins, and it is supposed
implicitely that the FIFO output availability is at least as quick as the system
bus and the DMA size is perfectly fit for the FIFO available bytes.

This is what has been the underlying of DMA transfers of smc91x(x) on the PXA
platforms, where the smc91x(s) are directly wired on the system bus (the same
bus having DRAM, SRAM, IO-mapped devices).

>
>> +       /* PXA25x specific map */
>> +       { "pxa25x-ssp.0", "rx", PDMA_FILTER_PARAM(LOWEST, 13) },
>> +       { "pxa25x-ssp.0", "tx", PDMA_FILTER_PARAM(LOWEST, 14) },
>> +       { "pxa25x-nssp.1", "rx", PDMA_FILTER_PARAM(LOWEST, 15) },
>> +       { "pxa25x-nssp.1", "tx", PDMA_FILTER_PARAM(LOWEST, 16) },
>> +       { "pxa25x-nssp.2", "rx", PDMA_FILTER_PARAM(LOWEST, 23) },
>> +       { "pxa25x-nssp.2", "tx", PDMA_FILTER_PARAM(LOWEST, 24) },
>> +       { "pxa-pcm-audio", "nssp2_rx", PDMA_FILTER_PARAM(LOWEST, 15) },
>> +       { "pxa-pcm-audio", "nssp2_tx", PDMA_FILTER_PARAM(LOWEST, 16) },
>> +       { "pxa-pcm-audio", "nssp3_rx", PDMA_FILTER_PARAM(LOWEST, 23) },
>> +       { "pxa-pcm-audio", "nssp3_tx", PDMA_FILTER_PARAM(LOWEST, 24) },
>> +
>> +       /* PXA27x specific map */
>> +       { "pxa-pcm-audio", "ssp3_rx", PDMA_FILTER_PARAM(LOWEST, 66) },
>> +       { "pxa-pcm-audio", "ssp3_tx", PDMA_FILTER_PARAM(LOWEST, 67) },
>> +       { "pxa27x-camera.0", "CI_Y", PDMA_FILTER_PARAM(HIGHEST, 68) },
>> +       { "pxa27x-camera.0", "CI_U", PDMA_FILTER_PARAM(HIGHEST, 69) },
>> +       { "pxa27x-camera.0", "CI_V", PDMA_FILTER_PARAM(HIGHEST, 70) },
>> +
>> +       /* PXA3xx specific map */
>> +       { "pxa-pcm-audio", "ssp4_rx", PDMA_FILTER_PARAM(LOWEST, 2) },
>> +       { "pxa-pcm-audio", "ssp4_tx", PDMA_FILTER_PARAM(LOWEST, 3) },
>> +       { "pxa2xx-mci.1", "rx", PDMA_FILTER_PARAM(LOWEST, 93) },
>> +       { "pxa2xx-mci.1", "tx", PDMA_FILTER_PARAM(LOWEST, 94) },
>> +       { "pxa3xx-nand", "data", PDMA_FILTER_PARAM(LOWEST, 97) },
>> +       { "pxa2xx-mci.2", "rx", PDMA_FILTER_PARAM(LOWEST, 100) },
>> +       { "pxa2xx-mci.2", "tx", PDMA_FILTER_PARAM(LOWEST, 101) },
>> +};
>
> Since more than half the entries in here are chip specific, maybe it would be
> better to split that table into three and have a copy for each one in
> arch/arm/mach-pxa/pxa{25x.27x.3xx}.c?
Mmmh, today the split is :
 - 16 common entries
 - 10 pxa25x specific entries
 - 5 pxa27x specific entries
 - 7 pxa3xx specific entries
 => total of 38 lines

After the split we'll have :
 - 26 pxa25x specific entries
 - 21 pxa27x specific entries
 - 23 pxa3xx specific entries
 => total of 70 lines

That doubles the number of lines, not counting the declarations, and amending of
pxa2xx_set_dmac_info().

If you think it's worth it, what is the driving benefit behind ?

> Does that mean it's actually a memory-to-memory transfer with a device being
> on the external SRAM interface?
I'm taking this is the follow up to the "-1" question :0

Cheers.

^ permalink raw reply	[flat|nested] 218+ messages in thread
* [02/15] ARM: pxa: add dma slave map
  2018-04-03 15:18 ` Robert Jarzmik
                   ` (3 preceding siblings ...)
  (?)
@ 2018-04-03 15:39 ` Arnd Bergmann
  -1 siblings, 0 replies; 218+ messages in thread
From: Arnd Bergmann @ 2018-04-03 15:39 UTC (permalink / raw)
  To: Robert Jarzmik
  Cc: Daniel Mack, Haojian Zhuang, Bartlomiej Zolnierkiewicz,
	Tejun Heo, Vinod Koul, Mauro Carvalho Chehab, Ulf Hansson,
	Ezequiel Garcia, Boris Brezillon, David Woodhouse, Brian Norris,
	Marek Vasut, Richard Weinberger, Cyrille Pitchen, Nicolas Pitre,
	Samuel Ortiz, Greg Kroah-Hartman, Jaroslav Kysela, Takashi Iwai,
	Liam Girdwood, Mark Brown, Russell King, Linux ARM,
	Linux Kernel Mailing List, IDE-ML, dmaengine,
	Linux Media Mailing List, linux-mmc, linux-mtd, Networking,
	devel, alsa-devel

On Tue, Apr 3, 2018 at 5:18 PM, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
> Arnd Bergmann <arnd@arndb.de> writes:
>
>>> +       { "smc911x.0", "rx", PDMA_FILTER_PARAM(LOWEST, -1) },
>>> +       { "smc911x.0", "tx", PDMA_FILTER_PARAM(LOWEST, -1) },
>>> +       { "smc91x.0", "data", PDMA_FILTER_PARAM(LOWEST, -1) },
>>
>> This one is interesting, as you are dealing with an off-chip device,
>> and the channel number is '-'1. How does this even work? Does it
>> mean
>
> This relies on pxa_dma, in which the "-1" for a requestor line means "no
> requestor" or said in another way "always requesting". As a consequence, as soon
> as the DMA descriptors are queued, the transfer begins, and it is supposed
> implicitely that the FIFO output availability is at least as quick as the system
> bus and the DMA size is perfectly fit for the FIFO available bytes.
>
> This is what has been the underlying of DMA transfers of smc91x(x) on the PXA
> platforms, where the smc91x(s) are directly wired on the system bus (the same
> bus having DRAM, SRAM, IO-mapped devices).

Ok, I looked at the driver in more detail now and found the scary parts.
So it's using the async DMA interface to do synchronous DMA in
interrupt context in order to transfer the rx data faster than an readsl()
would, correct?

It still feels odd to me that there is an entry in the slave map for
a device that does not have a request line. However, it also seems
that the entire code in those two drivers that deals with DMA is specific
to PXA anyway, so maybe it can be done differently: instead of
calling dma_request_slave_channel_compat() or dma_request_chan()
with a fake request line, how about calling dma_request_channel()
with an NULL filter function and data, and have the driver handle
the empty data case the same way as the rq=-1 case today?

>>> +       /* PXA25x specific map */
>>> +       { "pxa25x-ssp.0", "rx", PDMA_FILTER_PARAM(LOWEST, 13) },
>>> +       { "pxa25x-ssp.0", "tx", PDMA_FILTER_PARAM(LOWEST, 14) },
>>> +       { "pxa25x-nssp.1", "rx", PDMA_FILTER_PARAM(LOWEST, 15) },
>>> +       { "pxa25x-nssp.1", "tx", PDMA_FILTER_PARAM(LOWEST, 16) },
>>> +       { "pxa25x-nssp.2", "rx", PDMA_FILTER_PARAM(LOWEST, 23) },
>>> +       { "pxa25x-nssp.2", "tx", PDMA_FILTER_PARAM(LOWEST, 24) },
>>> +       { "pxa-pcm-audio", "nssp2_rx", PDMA_FILTER_PARAM(LOWEST, 15) },
>>> +       { "pxa-pcm-audio", "nssp2_tx", PDMA_FILTER_PARAM(LOWEST, 16) },
>>> +       { "pxa-pcm-audio", "nssp3_rx", PDMA_FILTER_PARAM(LOWEST, 23) },
>>> +       { "pxa-pcm-audio", "nssp3_tx", PDMA_FILTER_PARAM(LOWEST, 24) },
>>> +
>>> +       /* PXA27x specific map */
>>> +       { "pxa-pcm-audio", "ssp3_rx", PDMA_FILTER_PARAM(LOWEST, 66) },
>>> +       { "pxa-pcm-audio", "ssp3_tx", PDMA_FILTER_PARAM(LOWEST, 67) },
>>> +       { "pxa27x-camera.0", "CI_Y", PDMA_FILTER_PARAM(HIGHEST, 68) },
>>> +       { "pxa27x-camera.0", "CI_U", PDMA_FILTER_PARAM(HIGHEST, 69) },
>>> +       { "pxa27x-camera.0", "CI_V", PDMA_FILTER_PARAM(HIGHEST, 70) },
>>> +
>>> +       /* PXA3xx specific map */
>>> +       { "pxa-pcm-audio", "ssp4_rx", PDMA_FILTER_PARAM(LOWEST, 2) },
>>> +       { "pxa-pcm-audio", "ssp4_tx", PDMA_FILTER_PARAM(LOWEST, 3) },
>>> +       { "pxa2xx-mci.1", "rx", PDMA_FILTER_PARAM(LOWEST, 93) },
>>> +       { "pxa2xx-mci.1", "tx", PDMA_FILTER_PARAM(LOWEST, 94) },
>>> +       { "pxa3xx-nand", "data", PDMA_FILTER_PARAM(LOWEST, 97) },
>>> +       { "pxa2xx-mci.2", "rx", PDMA_FILTER_PARAM(LOWEST, 100) },
>>> +       { "pxa2xx-mci.2", "tx", PDMA_FILTER_PARAM(LOWEST, 101) },
>>> +};
>>
>> Since more than half the entries in here are chip specific, maybe it would be
>> better to split that table into three and have a copy for each one in
>> arch/arm/mach-pxa/pxa{25x.27x.3xx}.c?
> Mmmh, today the split is :
>  - 16 common entries
>  - 10 pxa25x specific entries
>  - 5 pxa27x specific entries
>  - 7 pxa3xx specific entries
>  => total of 38 lines
>
> After the split we'll have :
>  - 26 pxa25x specific entries
>  - 21 pxa27x specific entries
>  - 23 pxa3xx specific entries
>  => total of 70 lines
>
> That doubles the number of lines, not counting the declarations, and amending of
> pxa2xx_set_dmac_info().
>
> If you think it's worth it, what is the driving benefit behind ?

It seems a bit cleaner to only register the tables for the dma lines that
are actually present on a given chip.

>> Does that mean it's actually a memory-to-memory transfer with a device being
>> on the external SRAM interface?
> I'm taking this is the follow up to the "-1" question :0

Right.

        Arnd
---
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

^ permalink raw reply	[flat|nested] 218+ messages in thread
* [02/15] ARM: pxa: add dma slave map
  2018-04-03 15:39 ` Arnd Bergmann
  (?)
@ 2018-04-03 20:19 ` Robert Jarzmik
  -1 siblings, 0 replies; 218+ messages in thread
From: Robert Jarzmik @ 2018-04-03 20:19 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Daniel Mack, Haojian Zhuang, Vinod Koul, Linux ARM,
	Linux Kernel Mailing List, dmaengine

... chop chop removing unneeded recipients ....

Arnd Bergmann <arnd@arndb.de> writes:

> Ok, I looked at the driver in more detail now and found the scary parts.
> So it's using the async DMA interface to do synchronous DMA in
> interrupt context in order to transfer the rx data faster than an readsl()
> would, correct?
That's correct, at least for the smc91x.

> It still feels odd to me that there is an entry in the slave map for
> a device that does not have a request line. However, it also seems
> that the entire code in those two drivers that deals with DMA is specific
> to PXA anyway, so maybe it can be done differently: instead of
> calling dma_request_slave_channel_compat() or dma_request_chan()
> with a fake request line, how about calling dma_request_channel()
> with an NULL filter function and data, and have the driver handle
> the empty data case the same way as the rq=-1 case today?
Okay, in this case :
 - the channel priority cannot be passed anymore
 - and I don't see how this can work :
   dma_request_channel()
     __dma_request_channel()
       find_candidate()
         private_candidate(mask, device, fn, fn_param);
           /* Here, fn == NULL and fn_param == NULL as per your proposal */

   This function will find the first available dma channel, all right, but
   no function will be called in pxa_dma driver, and therefore the last
   requestor of the channel will be used, which is bad.

>> If you think it's worth it, what is the driving benefit behind ?
> It seems a bit cleaner to only register the tables for the dma lines that
> are actually present on a given chip.
Okay, let's do this.

Cheers.

^ permalink raw reply	[flat|nested] 218+ messages in thread
* [02/15] ARM: pxa: add dma slave map
  2018-04-03 20:19 ` Robert Jarzmik
  (?)
@ 2018-04-04 10:18 ` Arnd Bergmann
  -1 siblings, 0 replies; 218+ messages in thread
From: Arnd Bergmann @ 2018-04-04 10:18 UTC (permalink / raw)
  To: Robert Jarzmik
  Cc: Daniel Mack, Haojian Zhuang, Vinod Koul, Linux ARM,
	Linux Kernel Mailing List, dmaengine

On Tue, Apr 3, 2018 at 10:19 PM, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
> ... chop chop removing unneeded recipients ....
>
> Arnd Bergmann <arnd@arndb.de> writes:
>
>> Ok, I looked at the driver in more detail now and found the scary parts.
>> So it's using the async DMA interface to do synchronous DMA in
>> interrupt context in order to transfer the rx data faster than an readsl()
>> would, correct?
> That's correct, at least for the smc91x.
>
>> It still feels odd to me that there is an entry in the slave map for
>> a device that does not have a request line. However, it also seems
>> that the entire code in those two drivers that deals with DMA is specific
>> to PXA anyway, so maybe it can be done differently: instead of
>> calling dma_request_slave_channel_compat() or dma_request_chan()
>> with a fake request line, how about calling dma_request_channel()
>> with an NULL filter function and data, and have the driver handle
>> the empty data case the same way as the rq=-1 case today?
> Okay, in this case :
>  - the channel priority cannot be passed anymore

Right, but it could just always use a static priority, right?

>  - and I don't see how this can work :
>    dma_request_channel()
>      __dma_request_channel()
>        find_candidate()
>          private_candidate(mask, device, fn, fn_param);
>            /* Here, fn == NULL and fn_param == NULL as per your proposal */
>
>    This function will find the first available dma channel, all right, but
>    no function will be called in pxa_dma driver, and therefore the last
>    requestor of the channel will be used, which is bad.

Can't you just reset those in pxad_free_chan_resources()?

       Arnd
---
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

^ permalink raw reply	[flat|nested] 218+ messages in thread
* [02/15] ARM: pxa: add dma slave map
  2018-04-04 10:18 ` Arnd Bergmann
  (?)
@ 2018-04-04 19:21 ` Robert Jarzmik
  -1 siblings, 0 replies; 218+ messages in thread
From: Robert Jarzmik @ 2018-04-04 19:21 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Daniel Mack, Haojian Zhuang, Vinod Koul, Linux ARM,
	Linux Kernel Mailing List, dmaengine

Arnd Bergmann <arnd@arndb.de> writes:

> On Tue, Apr 3, 2018 at 10:19 PM, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
>> ... chop chop removing unneeded recipients ....
>>
>> Arnd Bergmann <arnd@arndb.de> writes:
>>> It still feels odd to me that there is an entry in the slave map for
>>> a device that does not have a request line. However, it also seems
>>> that the entire code in those two drivers that deals with DMA is specific
>>> to PXA anyway, so maybe it can be done differently: instead of
>>> calling dma_request_slave_channel_compat() or dma_request_chan()
>>> with a fake request line, how about calling dma_request_channel()
>>> with an NULL filter function and data, and have the driver handle
>>> the empty data case the same way as the rq=-1 case today?
>> Okay, in this case :
>>  - the channel priority cannot be passed anymore
>
> Right, but it could just always use a static priority, right?
Yes, an implicit default priority. I'm not a big fan of implicit parameters, yet
I can do it.

>>  - and I don't see how this can work :
>>    dma_request_channel()
>>      __dma_request_channel()
>>        find_candidate()
>>          private_candidate(mask, device, fn, fn_param);
>>            /* Here, fn == NULL and fn_param == NULL as per your proposal */
>>
>>    This function will find the first available dma channel, all right, but
>>    no function will be called in pxa_dma driver, and therefore the last
>>    requestor of the channel will be used, which is bad.
>
> Can't you just reset those in pxad_free_chan_resources()?
I can, let's see what happens next ...

Cheers.

^ permalink raw reply	[flat|nested] 218+ messages in thread
* [08/15] ASoC: pxa: remove the dmaengine compat need
  2018-04-02 14:26 ` Robert Jarzmik
                   ` (3 preceding siblings ...)
  (?)
@ 2018-04-12 15:26 ` Mark Brown
  -1 siblings, 0 replies; 218+ messages in thread
From: Mark Brown @ 2018-04-12 15:26 UTC (permalink / raw)
  To: Robert Jarzmik
  Cc: Daniel Mack, Haojian Zhuang, Bartlomiej Zolnierkiewicz,
	Tejun Heo, Vinod Koul, Mauro Carvalho Chehab, Ulf Hansson,
	Ezequiel Garcia, Boris Brezillon, David Woodhouse, Brian Norris,
	Marek Vasut, Richard Weinberger, Cyrille Pitchen, Nicolas Pitre,
	Samuel Ortiz, Greg Kroah-Hartman, Jaroslav Kysela, Takashi Iwai,
	Liam Girdwood, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-ide, dmaengine, linux-media, linux-mmc, linux-mtd, netdev,
	devel, alsa-devel

On Mon, Apr 02, 2018 at 04:26:49PM +0200, Robert Jarzmik wrote:
> As the pxa architecture switched towards the dmaengine slave map, the
> old compatibility mechanism to acquire the dma requestor line number and
> priority are not needed anymore.

Acked-by: Mark Brown <broonie@kernel.org>

If there's no dependency I'm happy to take this for 4.18.

^ permalink raw reply	[flat|nested] 218+ messages in thread
* [08/15] ASoC: pxa: remove the dmaengine compat need
  2018-04-12 15:26 ` Mark Brown
                   ` (3 preceding siblings ...)
  (?)
@ 2018-04-12 16:55 ` Robert Jarzmik
  -1 siblings, 0 replies; 218+ messages in thread
From: Robert Jarzmik @ 2018-04-12 16:55 UTC (permalink / raw)
  To: Mark Brown
  Cc: Daniel Mack, Haojian Zhuang, Bartlomiej Zolnierkiewicz,
	Tejun Heo, Vinod Koul, Mauro Carvalho Chehab, Ulf Hansson,
	Ezequiel Garcia, Boris Brezillon, David Woodhouse, Brian Norris,
	Marek Vasut, Richard Weinberger, Cyrille Pitchen, Nicolas Pitre,
	Samuel Ortiz, Greg Kroah-Hartman, Jaroslav Kysela, Takashi Iwai,
	Liam Girdwood, Arnd Bergmann, linux-arm-kernel, linux-kernel,
	linux-ide, dmaengine, linux-media, linux-mmc, linux-mtd, netdev,
	devel, alsa-devel

Mark Brown <broonie@kernel.org> writes:

> On Mon, Apr 02, 2018 at 04:26:49PM +0200, Robert Jarzmik wrote:
>> As the pxa architecture switched towards the dmaengine slave map, the
>> old compatibility mechanism to acquire the dma requestor line number and
>> priority are not needed anymore.
>
> Acked-by: Mark Brown <broonie@kernel.org>
>
> If there's no dependency I'm happy to take this for 4.18.
Thanks for the ack.

The patches 1 and 2 are the dependency here, so I'd rather push it through my
tree once the review is complete.

Cheers.

^ permalink raw reply	[flat|nested] 218+ messages in thread
* [01/15] dmaengine: pxa: use a dma slave map
  2018-04-21 19:23   ` Robert Jarzmik
  (?)
@ 2018-04-22  6:13 ` Vinod Koul
  -1 siblings, 0 replies; 218+ messages in thread
From: Vinod Koul @ 2018-04-22  6:13 UTC (permalink / raw)
  To: Robert Jarzmik; +Cc: Arnd Bergmann, linux-arm-kernel, linux-kernel, dmaengine

On Sat, Apr 21, 2018 at 09:23:05PM +0200, Robert Jarzmik wrote:
> Robert Jarzmik <robert.jarzmik@free.fr> writes:
> 
> > In order to remove the specific knowledge of the dma mapping from PXA
> > drivers, add a default slave map for pxa architectures.
> >
> > This won't impact MMP architecture, but is aimed only at all PXA boards.
> >
> > This is the first step, and once all drivers are converted,
> > pxad_filter_fn() will be made static, and the DMA resources removed from
> > device.c.
> >
> > Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
> > Reported-by: Arnd Bergmann <arnd@arndb.de>
> 
> Vinod, could I have your ack please ?

Sure thing:

Acked-By: Vinod Koul <vkoul@kernel.org>

^ permalink raw reply	[flat|nested] 218+ messages in thread
* [04/15] media: pxa_camera: remove the dmaengine compat need
  2018-04-02 14:26   ` Robert Jarzmik
  (?)
  (?)
@ 2018-04-22 11:06 ` Hans Verkuil
  -1 siblings, 0 replies; 218+ messages in thread
From: Hans Verkuil @ 2018-04-22 11:06 UTC (permalink / raw)
  To: Robert Jarzmik, Daniel Mack, Haojian Zhuang,
	Bartlomiej Zolnierkiewicz, Tejun Heo, Vinod Koul,
	Mauro Carvalho Chehab, Ulf Hansson, Ezequiel Garcia,
	Boris Brezillon, David Woodhouse, Brian Norris, Marek Vasut,
	Richard Weinberger, Cyrille Pitchen, Nicolas Pitre, Samuel Ortiz,
	Greg Kroah-Hartman, Jaroslav Kysela, Takashi Iwai, Liam Girdwood,
	Mark Brown, Arnd Bergmann, Petr Cvek, Sakari Ailus,
	Laurent Pinchart, Pravin Shedge, Flavio Ceolin, Robert Jarzmik
  Cc: linux-arm-kernel, linux-kernel, linux-ide, dmaengine,
	linux-media, linux-mmc, linux-mtd, netdev, devel, alsa-devel,
	Niklas Söderlund

On 04/02/2018 04:26 PM, Robert Jarzmik wrote:
> From: Robert Jarzmik <robert.jarzmik@renault.com>
> 
> As the pxa architecture switched towards the dmaengine slave map, the
> old compatibility mechanism to acquire the dma requestor line number and
> priority are not needed anymore.
> 
> This patch simplifies the dma resource acquisition, using the more
> generic function dma_request_slave_channel().
> 
> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

Regards,

	Hans

> ---
>  drivers/media/platform/pxa_camera.c | 22 +++-------------------
>  1 file changed, 3 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/media/platform/pxa_camera.c b/drivers/media/platform/pxa_camera.c
> index c71a00736541..4c82d1880753 100644
> --- a/drivers/media/platform/pxa_camera.c
> +++ b/drivers/media/platform/pxa_camera.c
> @@ -2357,8 +2357,6 @@ static int pxa_camera_probe(struct platform_device *pdev)
>  		.src_maxburst = 8,
>  		.direction = DMA_DEV_TO_MEM,
>  	};
> -	dma_cap_mask_t mask;
> -	struct pxad_param params;
>  	char clk_name[V4L2_CLK_NAME_SIZE];
>  	int irq;
>  	int err = 0, i;
> @@ -2432,34 +2430,20 @@ static int pxa_camera_probe(struct platform_device *pdev)
>  	pcdev->base = base;
>  
>  	/* request dma */
> -	dma_cap_zero(mask);
> -	dma_cap_set(DMA_SLAVE, mask);
> -	dma_cap_set(DMA_PRIVATE, mask);
> -
> -	params.prio = 0;
> -	params.drcmr = 68;
> -	pcdev->dma_chans[0] =
> -		dma_request_slave_channel_compat(mask, pxad_filter_fn,
> -						 &params, &pdev->dev, "CI_Y");
> +	pcdev->dma_chans[0] = dma_request_slave_channel(&pdev->dev, "CI_Y");
>  	if (!pcdev->dma_chans[0]) {
>  		dev_err(&pdev->dev, "Can't request DMA for Y\n");
>  		return -ENODEV;
>  	}
>  
> -	params.drcmr = 69;
> -	pcdev->dma_chans[1] =
> -		dma_request_slave_channel_compat(mask, pxad_filter_fn,
> -						 &params, &pdev->dev, "CI_U");
> +	pcdev->dma_chans[1] = dma_request_slave_channel(&pdev->dev, "CI_U");
>  	if (!pcdev->dma_chans[1]) {
>  		dev_err(&pdev->dev, "Can't request DMA for Y\n");
>  		err = -ENODEV;
>  		goto exit_free_dma_y;
>  	}
>  
> -	params.drcmr = 70;
> -	pcdev->dma_chans[2] =
> -		dma_request_slave_channel_compat(mask, pxad_filter_fn,
> -						 &params, &pdev->dev, "CI_V");
> +	pcdev->dma_chans[2] = dma_request_slave_channel(&pdev->dev, "CI_V");
>  	if (!pcdev->dma_chans[2]) {
>  		dev_err(&pdev->dev, "Can't request DMA for V\n");
>  		err = -ENODEV;
>
---
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

^ permalink raw reply	[flat|nested] 218+ messages in thread
* [09/15] net: irda: pxaficp_ir: remove the dmaengine compat need
  2018-04-02 14:26   ` Robert Jarzmik
                   ` (2 preceding siblings ...)
  (?)
@ 2018-04-23  8:37 ` Greg Kroah-Hartman
  -1 siblings, 0 replies; 218+ messages in thread
From: Greg Kroah-Hartman @ 2018-04-23  8:37 UTC (permalink / raw)
  To: Robert Jarzmik
  Cc: Daniel Mack, Haojian Zhuang, Bartlomiej Zolnierkiewicz,
	Tejun Heo, Vinod Koul, Mauro Carvalho Chehab, Ulf Hansson,
	Ezequiel Garcia, Boris Brezillon, David Woodhouse, Brian Norris,
	Marek Vasut, Richard Weinberger, Cyrille Pitchen, Nicolas Pitre,
	Samuel Ortiz, Jaroslav Kysela, Takashi Iwai, Liam Girdwood,
	Mark Brown, Arnd Bergmann, David S. Miller, Pravin Shedge,
	linux-arm-kernel, linux-kernel, linux-ide, dmaengine,
	linux-media, linux-mmc, linux-mtd, netdev, devel, alsa-devel

On Mon, Apr 02, 2018 at 04:26:50PM +0200, Robert Jarzmik wrote:
> As the pxa architecture switched towards the dmaengine slave map, the
> old compatibility mechanism to acquire the dma requestor line number and
> priority are not needed anymore.
> 
> This patch simplifies the dma resource acquisition, using the more
> generic function dma_request_slave_channel().
> 
> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
> ---
>  drivers/staging/irda/drivers/pxaficp_ir.c | 14 ++------------
>  1 file changed, 2 insertions(+), 12 deletions(-)

This file is no longer in Linus's tree :)

thanks,

greg k-h
---
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

^ permalink raw reply	[flat|nested] 218+ messages in thread
* [04/15] media: pxa_camera: remove the dmaengine compat need
  2018-04-22 11:06 ` Hans Verkuil
                   ` (2 preceding siblings ...)
  (?)
@ 2018-05-04 19:29 ` Mauro Carvalho Chehab
  -1 siblings, 0 replies; 218+ messages in thread
From: Mauro Carvalho Chehab @ 2018-05-04 19:29 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: Robert Jarzmik, Daniel Mack, Haojian Zhuang,
	Bartlomiej Zolnierkiewicz, Tejun Heo, Vinod Koul,
	Mauro Carvalho Chehab, Ulf Hansson, Ezequiel Garcia,
	Boris Brezillon, David Woodhouse, Brian Norris, Marek Vasut,
	Richard Weinberger, Cyrille Pitchen, Nicolas Pitre, Samuel Ortiz,
	Greg Kroah-Hartman, Jaroslav Kysela, Takashi Iwai, Liam Girdwood,
	Mark Brown, Arnd Bergmann, Petr Cvek, Sakari Ailus,
	Laurent Pinchart, Pravin Shedge, Flavio Ceolin, Robert Jarzmik,
	linux-arm-kernel, linux-kernel, linux-ide, dmaengine,
	linux-media, linux-mmc, linux-mtd, netdev, devel, alsa-devel,
	Niklas Söderlund

Em Sun, 22 Apr 2018 13:06:12 +0200
Hans Verkuil <hverkuil@xs4all.nl> escreveu:

> On 04/02/2018 04:26 PM, Robert Jarzmik wrote:
> > From: Robert Jarzmik <robert.jarzmik@renault.com>
> > 
> > As the pxa architecture switched towards the dmaengine slave map, the
> > old compatibility mechanism to acquire the dma requestor line number and
> > priority are not needed anymore.
> > 
> > This patch simplifies the dma resource acquisition, using the more
> > generic function dma_request_slave_channel().
> > 
> > Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>  
> 
> Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

I'm assuming that you'll be applying it together with other PXA patches.
So:

Acked-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>

Regards,
Mauro
> 
> Regards,
> 
> 	Hans
> 
> > ---
> >  drivers/media/platform/pxa_camera.c | 22 +++-------------------
> >  1 file changed, 3 insertions(+), 19 deletions(-)
> > 
> > diff --git a/drivers/media/platform/pxa_camera.c b/drivers/media/platform/pxa_camera.c
> > index c71a00736541..4c82d1880753 100644
> > --- a/drivers/media/platform/pxa_camera.c
> > +++ b/drivers/media/platform/pxa_camera.c
> > @@ -2357,8 +2357,6 @@ static int pxa_camera_probe(struct platform_device *pdev)
> >  		.src_maxburst = 8,
> >  		.direction = DMA_DEV_TO_MEM,
> >  	};
> > -	dma_cap_mask_t mask;
> > -	struct pxad_param params;
> >  	char clk_name[V4L2_CLK_NAME_SIZE];
> >  	int irq;
> >  	int err = 0, i;
> > @@ -2432,34 +2430,20 @@ static int pxa_camera_probe(struct platform_device *pdev)
> >  	pcdev->base = base;
> >  
> >  	/* request dma */
> > -	dma_cap_zero(mask);
> > -	dma_cap_set(DMA_SLAVE, mask);
> > -	dma_cap_set(DMA_PRIVATE, mask);
> > -
> > -	params.prio = 0;
> > -	params.drcmr = 68;
> > -	pcdev->dma_chans[0] =
> > -		dma_request_slave_channel_compat(mask, pxad_filter_fn,
> > -						 &params, &pdev->dev, "CI_Y");
> > +	pcdev->dma_chans[0] = dma_request_slave_channel(&pdev->dev, "CI_Y");
> >  	if (!pcdev->dma_chans[0]) {
> >  		dev_err(&pdev->dev, "Can't request DMA for Y\n");
> >  		return -ENODEV;
> >  	}
> >  
> > -	params.drcmr = 69;
> > -	pcdev->dma_chans[1] =
> > -		dma_request_slave_channel_compat(mask, pxad_filter_fn,
> > -						 &params, &pdev->dev, "CI_U");
> > +	pcdev->dma_chans[1] = dma_request_slave_channel(&pdev->dev, "CI_U");
> >  	if (!pcdev->dma_chans[1]) {
> >  		dev_err(&pdev->dev, "Can't request DMA for Y\n");
> >  		err = -ENODEV;
> >  		goto exit_free_dma_y;
> >  	}
> >  
> > -	params.drcmr = 70;
> > -	pcdev->dma_chans[2] =
> > -		dma_request_slave_channel_compat(mask, pxad_filter_fn,
> > -						 &params, &pdev->dev, "CI_V");
> > +	pcdev->dma_chans[2] = dma_request_slave_channel(&pdev->dev, "CI_V");
> >  	if (!pcdev->dma_chans[2]) {
> >  		dev_err(&pdev->dev, "Can't request DMA for V\n");
> >  		err = -ENODEV;
> >   
> 



Thanks,
Mauro
---
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

^ permalink raw reply	[flat|nested] 218+ messages in thread
* [05/15] mtd: nand: pxa3xx: remove the dmaengine compat need
  2018-04-02 14:26   ` Robert Jarzmik
  (?)
  (?)
@ 2018-05-18 21:31 ` Daniel Mack
  -1 siblings, 0 replies; 218+ messages in thread
From: Daniel Mack @ 2018-05-18 21:31 UTC (permalink / raw)
  To: Robert Jarzmik, Haojian Zhuang, Bartlomiej Zolnierkiewicz,
	Tejun Heo, Vinod Koul, Mauro Carvalho Chehab, Ulf Hansson,
	Ezequiel Garcia, Boris Brezillon, David Woodhouse, Brian Norris,
	Marek Vasut, Richard Weinberger, Cyrille Pitchen, Nicolas Pitre,
	Samuel Ortiz, Greg Kroah-Hartman, Jaroslav Kysela, Takashi Iwai,
	Liam Girdwood, Mark Brown, Arnd Bergmann
  Cc: linux-arm-kernel, linux-kernel, linux-ide, dmaengine,
	linux-media, linux-mmc, linux-mtd, netdev, devel, alsa-devel,
	Robert Jarzmik

Hi Robert,

Thanks for this series.

On Monday, April 02, 2018 04:26 PM, Robert Jarzmik wrote:
> From: Robert Jarzmik <robert.jarzmik@renault.com>
> 
> As the pxa architecture switched towards the dmaengine slave map, the
> old compatibility mechanism to acquire the dma requestor line number and
> priority are not needed anymore.
> 
> This patch simplifies the dma resource acquisition, using the more
> generic function dma_request_slave_channel().
> 
> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
> ---
>   drivers/mtd/nand/pxa3xx_nand.c | 10 +---------

This driver was replaced by drivers/mtd/nand/raw/marvell_nand.c 
recently, so this patch can be dropped. I attached a version for the new 
driver which you can pick instead.


Thanks,
Daniel

From c63bc40bdfe2d596e42919235840109a2f1b2776 Mon Sep 17 00:00:00 2001
From: Daniel Mack <daniel@zonque.org>
Date: Sat, 12 May 2018 21:50:13 +0200
Subject: [PATCH] mtd: rawnand: marvell: remove dmaengine compat code

As the pxa architecture switched towards the dmaengine slave map, the
old compatibility mechanism to acquire the dma requestor line number and
priority are not needed anymore.

This patch simplifies the dma resource acquisition, using the more
generic function dma_request_slave_channel().

Signed-off-by: Daniel Mack <daniel@zonque.org>
---
 drivers/mtd/nand/raw/marvell_nand.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
index ebb1d141b900..30017cd7d91c 100644
--- a/drivers/mtd/nand/raw/marvell_nand.c
+++ b/drivers/mtd/nand/raw/marvell_nand.c
@@ -2612,8 +2612,6 @@ static int marvell_nfc_init_dma(struct marvell_nfc *nfc)
 						    dev);
 	struct dma_slave_config config = {};
 	struct resource *r;
-	dma_cap_mask_t mask;
-	struct pxad_param param;
 	int ret;
 
 	if (!IS_ENABLED(CONFIG_PXA_DMA)) {
@@ -2632,14 +2630,7 @@ static int marvell_nfc_init_dma(struct marvell_nfc *nfc)
 		return -ENXIO;
 	}
 
-	param.drcmr = r->start;
-	param.prio = PXAD_PRIO_LOWEST;
-	dma_cap_zero(mask);
-	dma_cap_set(DMA_SLAVE, mask);
-	nfc->dma_chan =
-		dma_request_slave_channel_compat(mask, pxad_filter_fn,
-						 &param, nfc->dev,
-						 "data");
+	nfc->dma_chan = dma_request_slave_channel(nfc->dev, "data");
 	if (!nfc->dma_chan) {
 		dev_err(nfc->dev,
 			"Unable to request data DMA channel\n");
-- 
2.14.3


^ permalink raw reply related	[flat|nested] 218+ messages in thread
* [05/15] mtd: nand: pxa3xx: remove the dmaengine compat need
  2018-05-18 21:31 ` Daniel Mack
  (?)
  (?)
@ 2018-05-23 21:54 ` Daniel Mack
  -1 siblings, 0 replies; 218+ messages in thread
From: Daniel Mack @ 2018-05-23 21:54 UTC (permalink / raw)
  To: Robert Jarzmik, Haojian Zhuang, Bartlomiej Zolnierkiewicz,
	Tejun Heo, Vinod Koul, Mauro Carvalho Chehab, Ulf Hansson,
	Ezequiel Garcia, Boris Brezillon, David Woodhouse, Brian Norris,
	Marek Vasut, Richard Weinberger, Cyrille Pitchen, Nicolas Pitre,
	Samuel Ortiz, Greg Kroah-Hartman, Jaroslav Kysela, Takashi Iwai,
	Liam Girdwood, Mark Brown, Arnd Bergmann
  Cc: linux-arm-kernel, linux-kernel, linux-ide, dmaengine,
	linux-media, linux-mmc, linux-mtd, netdev, devel, alsa-devel,
	Robert Jarzmik

Hi Robert,

Please refer to the attached patch instead of the one I sent earlier. I 
missed to also remove the platform_get_resource(IORESOURCE_DMA) call.


Thanks,
Daniel


On Friday, May 18, 2018 11:31 PM, Daniel Mack wrote:
> Hi Robert,
> 
> Thanks for this series.
> 
> On Monday, April 02, 2018 04:26 PM, Robert Jarzmik wrote:
>> From: Robert Jarzmik <robert.jarzmik@renault.com>
>>
>> As the pxa architecture switched towards the dmaengine slave map, the
>> old compatibility mechanism to acquire the dma requestor line number and
>> priority are not needed anymore.
>>
>> This patch simplifies the dma resource acquisition, using the more
>> generic function dma_request_slave_channel().
>>
>> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
>> ---
>>    drivers/mtd/nand/pxa3xx_nand.c | 10 +---------
> 
> This driver was replaced by drivers/mtd/nand/raw/marvell_nand.c
> recently, so this patch can be dropped. I attached a version for the new
> driver which you can pick instead.
> 
> 
> Thanks,
> Daniel
>

From 72a306157dedb21f8c3289f0f7a288fc4542bd96 Mon Sep 17 00:00:00 2001
From: Daniel Mack <daniel@zonque.org>
Date: Sat, 12 May 2018 21:50:13 +0200
Subject: [PATCH] mtd: rawnand: marvell: remove dmaengine compat code

As the pxa architecture switched towards the dmaengine slave map, the
old compatibility mechanism to acquire the dma requestor line number and
priority are not needed anymore.

This patch simplifies the dma resource acquisition, using the more
generic function dma_request_slave_channel().

Signed-off-by: Daniel Mack <daniel@zonque.org>
---
 drivers/mtd/nand/raw/marvell_nand.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
index ebb1d141b900..319fea77daf1 100644
--- a/drivers/mtd/nand/raw/marvell_nand.c
+++ b/drivers/mtd/nand/raw/marvell_nand.c
@@ -2612,8 +2612,6 @@ static int marvell_nfc_init_dma(struct marvell_nfc *nfc)
 						    dev);
 	struct dma_slave_config config = {};
 	struct resource *r;
-	dma_cap_mask_t mask;
-	struct pxad_param param;
 	int ret;
 
 	if (!IS_ENABLED(CONFIG_PXA_DMA)) {
@@ -2626,20 +2624,7 @@ static int marvell_nfc_init_dma(struct marvell_nfc *nfc)
 	if (ret)
 		return ret;
 
-	r = platform_get_resource(pdev, IORESOURCE_DMA, 0);
-	if (!r) {
-		dev_err(nfc->dev, "No resource defined for data DMA\n");
-		return -ENXIO;
-	}
-
-	param.drcmr = r->start;
-	param.prio = PXAD_PRIO_LOWEST;
-	dma_cap_zero(mask);
-	dma_cap_set(DMA_SLAVE, mask);
-	nfc->dma_chan =
-		dma_request_slave_channel_compat(mask, pxad_filter_fn,
-						 &param, nfc->dev,
-						 "data");
+	nfc->dma_chan = dma_request_slave_channel(nfc->dev, "data");
 	if (!nfc->dma_chan) {
 		dev_err(nfc->dev,
 			"Unable to request data DMA channel\n");
-- 
2.14.3


^ permalink raw reply related	[flat|nested] 218+ messages in thread

end of thread, other threads:[~2018-05-23 21:54 UTC | newest]

Thread overview: 218+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-02 14:26 [PATCH 00/15] ARM: pxa: switch to DMA slave maps Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 14:26 ` [01/15] dmaengine: pxa: use a dma slave map Robert Jarzmik
2018-04-02 14:26   ` [PATCH 01/15] " Robert Jarzmik
2018-04-02 14:26   ` Robert Jarzmik
2018-04-02 14:26   ` Robert Jarzmik
2018-04-02 14:26   ` Robert Jarzmik
2018-04-21 19:23   ` Robert Jarzmik
2018-04-02 14:26 ` [04/15] media: pxa_camera: remove the dmaengine compat need Robert Jarzmik
2018-04-02 14:26   ` [PATCH 04/15] " Robert Jarzmik
2018-04-02 14:26   ` Robert Jarzmik
2018-04-02 14:26   ` Robert Jarzmik
2018-04-21 19:27   ` Robert Jarzmik
2018-04-21 19:27     ` Robert Jarzmik
2018-04-22 11:06     ` Hans Verkuil
2018-04-22 11:06       ` Hans Verkuil
2018-04-02 14:26 ` [05/15] mtd: nand: pxa3xx: " Robert Jarzmik
2018-04-02 14:26   ` [PATCH 05/15] " Robert Jarzmik
2018-04-02 14:26   ` Robert Jarzmik
2018-04-02 14:26   ` Robert Jarzmik
2018-04-02 14:26   ` Robert Jarzmik
2018-04-03  7:33   ` Miquel Raynal
2018-04-03 15:19     ` Robert Jarzmik
2018-04-02 14:26 ` [09/15] net: irda: pxaficp_ir: " Robert Jarzmik
2018-04-02 14:26   ` [PATCH 09/15] " Robert Jarzmik
2018-04-02 14:26   ` Robert Jarzmik
2018-04-02 14:26   ` Robert Jarzmik
2018-04-02 14:26   ` Robert Jarzmik
2018-04-21 19:30   ` Robert Jarzmik
2018-04-21 19:30     ` Robert Jarzmik
2018-04-02 14:26 ` [10/15] ata: pata_pxa: " Robert Jarzmik
2018-04-02 14:26   ` [PATCH 10/15] " Robert Jarzmik
2018-04-02 14:26   ` Robert Jarzmik
2018-04-02 14:26   ` Robert Jarzmik
2018-04-02 14:26   ` Robert Jarzmik
2018-04-21 19:32   ` Robert Jarzmik
2018-04-21 19:32     ` Robert Jarzmik
2018-04-24 11:04     ` Bartlomiej Zolnierkiewicz
2018-04-24 11:04       ` Bartlomiej Zolnierkiewicz
2018-04-02 14:26 ` [14/15] ARM: pxa: change SSP devices allocation Robert Jarzmik
2018-04-02 14:26   ` [PATCH 14/15] " Robert Jarzmik
2018-04-02 14:26   ` Robert Jarzmik
2018-04-02 14:26   ` Robert Jarzmik
2018-04-02 14:26   ` Robert Jarzmik
2018-04-03  7:06   ` [14/15] " Arnd Bergmann
2018-04-03  7:06     ` [PATCH 14/15] " Arnd Bergmann
2018-04-03  7:06     ` Arnd Bergmann
2018-04-03  7:06     ` Arnd Bergmann
2018-04-03  7:06     ` Arnd Bergmann
2018-04-03  7:06     ` Arnd Bergmann
2018-04-03 15:32     ` Robert Jarzmik
2018-04-03 15:32       ` Robert Jarzmik
2018-04-03 15:53       ` Arnd Bergmann
2018-04-03 15:53         ` Arnd Bergmann
2018-04-05  6:51         ` Robert Jarzmik
2018-04-05  6:51           ` Robert Jarzmik
2018-04-05  7:29           ` Arnd Bergmann
2018-04-05  7:29             ` Arnd Bergmann
2018-04-08 12:16             ` Robert Jarzmik
2018-04-08 12:16               ` Robert Jarzmik
2018-04-08 12:16               ` Robert Jarzmik
2018-04-03  7:15 ` [PATCH 00/15] ARM: pxa: switch to DMA slave maps Arnd Bergmann
2018-04-03  7:15   ` Arnd Bergmann
2018-04-03  7:15   ` Arnd Bergmann
2018-04-03  7:15   ` Arnd Bergmann
2018-04-03  7:15   ` Arnd Bergmann
2018-04-03 15:08 ` Ulf Hansson
2018-04-03 15:08   ` Ulf Hansson
2018-04-03 15:08   ` Ulf Hansson
2018-04-03 15:08   ` Ulf Hansson
2018-04-04 19:49   ` Robert Jarzmik
2018-04-04 19:49     ` Robert Jarzmik
2018-04-04 19:49     ` Robert Jarzmik
2018-04-04 19:49     ` Robert Jarzmik
2018-04-04 19:56     ` Boris Brezillon
2018-04-04 19:56       ` Boris Brezillon
2018-04-04 19:56       ` Boris Brezillon
2018-04-04 19:56       ` Boris Brezillon
2018-04-04 19:56       ` Boris Brezillon
2018-04-05  6:29       ` Ulf Hansson
2018-04-05  6:29         ` Ulf Hansson
2018-04-05  6:29         ` Ulf Hansson
2018-04-05  6:29         ` Ulf Hansson
2018-04-05  6:50         ` Arnd Bergmann
2018-04-05  6:50           ` Arnd Bergmann
2018-04-05  6:50           ` Arnd Bergmann
2018-04-05  6:50           ` Arnd Bergmann
2018-04-02 14:26 [02/15] ARM: pxa: add dma slave map Robert Jarzmik
2018-04-02 14:26 ` [PATCH 02/15] " Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 14:26 [03/15] mmc: pxamci: remove the dmaengine compat need Robert Jarzmik
2018-04-02 14:26 ` [PATCH 03/15] " Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 14:26 [06/15] net: smc911x: " Robert Jarzmik
2018-04-02 14:26 ` [PATCH 06/15] " Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 14:26 [07/15] net: smc91x: " Robert Jarzmik
2018-04-02 14:26 ` [PATCH 07/15] " Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 14:26 [08/15] ASoC: pxa: " Robert Jarzmik
2018-04-02 14:26 ` [PATCH 08/15] " Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 14:26 [11/15] dmaengine: pxa: document pxad_param Robert Jarzmik
2018-04-02 14:26 ` [PATCH 11/15] " Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 14:26 [12/15] dmaengine: pxa: make the filter function internal Robert Jarzmik
2018-04-02 14:26 ` [PATCH 12/15] " Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 14:26 [13/15] ARM: pxa: remove the DMA IO resources Robert Jarzmik
2018-04-02 14:26 ` [PATCH 13/15] " Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 14:26 [15/15] ARM: pxa: change SSP DMA channels allocation Robert Jarzmik
2018-04-02 14:26 ` [PATCH 15/15] " Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 14:26 ` Robert Jarzmik
2018-04-02 16:25 [12/15] dmaengine: pxa: make the filter function internal kbuild test robot
2018-04-02 16:25 ` [PATCH 12/15] " kbuild test robot
2018-04-02 16:25 ` kbuild test robot
2018-04-02 16:25 ` kbuild test robot
2018-04-02 16:25 ` kbuild test robot
2018-04-02 16:35 [12/15] " kbuild test robot
2018-04-02 16:35 ` [PATCH 12/15] " kbuild test robot
2018-04-02 16:35 ` kbuild test robot
2018-04-02 16:35 ` kbuild test robot
2018-04-02 16:35 ` kbuild test robot
2018-04-02 16:35 ` kbuild test robot
2018-04-02 18:46 [15/15] ARM: pxa: change SSP DMA channels allocation kbuild test robot
2018-04-02 18:46 ` [PATCH 15/15] " kbuild test robot
2018-04-02 18:46 ` kbuild test robot
2018-04-02 18:46 ` kbuild test robot
2018-04-02 18:46 ` kbuild test robot
2018-04-03  6:51 [02/15] ARM: pxa: add dma slave map Arnd Bergmann
2018-04-03  6:51 ` [PATCH 02/15] " Arnd Bergmann
2018-04-03  6:51 ` Arnd Bergmann
2018-04-03  6:51 ` Arnd Bergmann
2018-04-03  6:51 ` Arnd Bergmann
2018-04-03  6:51 ` Arnd Bergmann
2018-04-03  7:13 [12/15] dmaengine: pxa: make the filter function internal Arnd Bergmann
2018-04-03  7:13 ` [PATCH 12/15] " Arnd Bergmann
2018-04-03  7:13 ` Arnd Bergmann
2018-04-03  7:13 ` Arnd Bergmann
2018-04-03  7:13 ` Arnd Bergmann
2018-04-03  7:13 ` Arnd Bergmann
2018-04-03 15:18 [02/15] ARM: pxa: add dma slave map Robert Jarzmik
2018-04-03 15:18 ` [PATCH 02/15] " Robert Jarzmik
2018-04-03 15:18 ` Robert Jarzmik
2018-04-03 15:18 ` Robert Jarzmik
2018-04-03 15:18 ` Robert Jarzmik
2018-04-03 15:39 [02/15] " Arnd Bergmann
2018-04-03 15:39 ` [PATCH 02/15] " Arnd Bergmann
2018-04-03 15:39 ` Arnd Bergmann
2018-04-03 15:39 ` Arnd Bergmann
2018-04-03 15:39 ` Arnd Bergmann
2018-04-03 15:39 ` Arnd Bergmann
2018-04-03 20:19 [02/15] " Robert Jarzmik
2018-04-03 20:19 ` [PATCH 02/15] " Robert Jarzmik
2018-04-03 20:19 ` Robert Jarzmik
2018-04-04 10:18 [02/15] " Arnd Bergmann
2018-04-04 10:18 ` [PATCH 02/15] " Arnd Bergmann
2018-04-04 10:18 ` Arnd Bergmann
2018-04-04 19:21 [02/15] " Robert Jarzmik
2018-04-04 19:21 ` [PATCH 02/15] " Robert Jarzmik
2018-04-04 19:21 ` Robert Jarzmik
2018-04-12 15:26 [08/15] ASoC: pxa: remove the dmaengine compat need Mark Brown
2018-04-12 15:26 ` [PATCH 08/15] " Mark Brown
2018-04-12 15:26 ` Mark Brown
2018-04-12 15:26 ` Mark Brown
2018-04-12 15:26 ` Mark Brown
2018-04-12 15:26 ` Mark Brown
2018-04-12 16:55 [08/15] " Robert Jarzmik
2018-04-12 16:55 ` [PATCH 08/15] " Robert Jarzmik
2018-04-12 16:55 ` Robert Jarzmik
2018-04-12 16:55 ` Robert Jarzmik
2018-04-12 16:55 ` Robert Jarzmik
2018-04-12 16:55 ` Robert Jarzmik
2018-04-22  6:13 [01/15] dmaengine: pxa: use a dma slave map Vinod Koul
2018-04-22  6:13 ` [PATCH 01/15] " Vinod Koul
2018-04-22  6:13 ` Vinod Koul
2018-04-22 11:06 [04/15] media: pxa_camera: remove the dmaengine compat need Hans Verkuil
2018-04-22 11:06 ` [PATCH 04/15] " Hans Verkuil
2018-04-22 11:06 ` Hans Verkuil
2018-04-22 11:06 ` Hans Verkuil
2018-04-23  8:37 [09/15] net: irda: pxaficp_ir: " Greg Kroah-Hartman
2018-04-23  8:37 ` [PATCH 09/15] " Greg Kroah-Hartman
2018-04-23  8:37 ` Greg Kroah-Hartman
2018-04-23  8:37 ` Greg Kroah-Hartman
2018-04-23  8:37 ` Greg Kroah-Hartman
2018-05-04 19:29 [04/15] media: pxa_camera: " Mauro Carvalho Chehab
2018-05-04 19:29 ` [PATCH 04/15] " Mauro Carvalho Chehab
2018-05-04 19:29 ` Mauro Carvalho Chehab
2018-05-04 19:29 ` Mauro Carvalho Chehab
2018-05-04 19:29 ` Mauro Carvalho Chehab
2018-05-18 21:31 [05/15] mtd: nand: pxa3xx: " Daniel Mack
2018-05-18 21:31 ` [PATCH 05/15] " Daniel Mack
2018-05-18 21:31 ` Daniel Mack
2018-05-18 21:31 ` Daniel Mack
2018-05-23 21:54 [05/15] " Daniel Mack
2018-05-23 21:54 ` [PATCH 05/15] " Daniel Mack
2018-05-23 21:54 ` Daniel Mack
2018-05-23 21:54 ` Daniel Mack

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.