Skip to contentSkip to conversation

dmaengine: Add DMA_PRIVATE to BCM2835 driver

PATCH Applied Florian Meier 2 participants 2 messages Jan 17, 2014 – Jan 20, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dmaengine: Add DMA_PRIVATE to BCM2835 driver

Without DMA_PRIVATE the driver is not able to allocate more than one channel. Since it uses dma_get_any_slave_channel that calls private_candidate, the second allocation fails at
/* some channels are already publicly allocated */
Maybe it should be fixed in the core, but at least this fixes the bug.

---
 drivers/dma/bcm2835-dma.c | 1 +
 1 file changed, 1 insertion(+)
drivers/dma/bcm2835-dma.c +1 -0
index 6ae0708..a036021 100644
@@ -611,6 +611,7 @@ static int bcm2835_dma_probe(struct platform_device *pdev)
 	od->base = base;
 
 	dma_cap_set(DMA_SLAVE, od->ddev.cap_mask);
+	dma_cap_set(DMA_PRIVATE, od->ddev.cap_mask);
 	dma_cap_set(DMA_CYCLIC, od->ddev.cap_mask);
 	od->ddev.device_alloc_chan_resources = bcm2835_dma_alloc_chan_resources;
 	od->ddev.device_free_chan_resources = bcm2835_dma_free_chan_resources;
Signature · 1 line
1.8.3.2
Applied
#1 lore raw
Quoted 16 lines · Florian Meier

Without DMA_PRIVATE the driver is not able to allocate more than one channel. Since it uses dma_get_any_slave_channel that calls private_candidate, the second allocation fails at
/* some channels are already publicly allocated */
Maybe it should be fixed in the core, but at least this fixes the bug.

---
 drivers/dma/bcm2835-dma.c | 1 +
 1 file changed, 1 insertion(+)
drivers/dma/bcm2835-dma.c +0 -0
index 6ae0708..a036021 100644

drivers/dma/bcm2835-dma.c static int bcm2835_dma_probe(struct platform_device *pdev) · line 617

Quoted 7 lines
drivers/dma/bcm2835-dma.c +1 -0
@@ -611,6 +611,7 @@ static int bcm2835_dma_probe(struct platform_device *pdev)
 	od->base = base;
 
 	dma_cap_set(DMA_SLAVE, od->ddev.cap_mask);
+	dma_cap_set(DMA_PRIVATE, od->ddev.cap_mask);
 	dma_cap_set(DMA_CYCLIC, od->ddev.cap_mask);
 	od->ddev.device_alloc_chan_resources = bcm2835_dma_alloc_chan_resources;
 	od->ddev.device_free_chan_resources = bcm2835_dma_free_chan_resources;

Applied, thanks

--
~Vinod