Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1251543

[PATCH 3/4] dmaengine: axi_dmac: Add synchronization support

From Lars-Peter Clausen <lars@metafoo.de>
Newsgroups linux.kernel
Subject [PATCH 3/4] dmaengine: axi_dmac: Add synchronization support
Date 2015-10-20 11:50 +0200
Message-ID <qlBIn-8jI-35@gated-at.bofh.it> (permalink)
References <qlBIm-8jI-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Implement the new device_synchronize() callback to allow proper
synchronization when stopping a channel. Since the driver already makes
sure that no new complete callbacks are scheduled after the
device_terminate_all() callback has been called, all left to do in the
device_synchronize() callback is to wait for all currently running complete
callbacks to finish.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/dma/dma-axi-dmac.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/dma/dma-axi-dmac.c b/drivers/dma/dma-axi-dmac.c
index 5b2395e..c346809 100644
--- a/drivers/dma/dma-axi-dmac.c
+++ b/drivers/dma/dma-axi-dmac.c
@@ -307,6 +307,13 @@ static int axi_dmac_terminate_all(struct dma_chan *c)
 	return 0;
 }
 
+static void axi_dmac_synchronize(struct dma_chan *c)
+{
+	struct axi_dmac_chan *chan = to_axi_dmac_chan(c);
+
+	vchan_synchronize(&chan->vchan);
+}
+
 static void axi_dmac_issue_pending(struct dma_chan *c)
 {
 	struct axi_dmac_chan *chan = to_axi_dmac_chan(c);
@@ -613,6 +620,7 @@ static int axi_dmac_probe(struct platform_device *pdev)
 	dma_dev->device_prep_dma_cyclic = axi_dmac_prep_dma_cyclic;
 	dma_dev->device_prep_interleaved_dma = axi_dmac_prep_interleaved;
 	dma_dev->device_terminate_all = axi_dmac_terminate_all;
+	dma_dev->device_synchronize = axi_dmac_synchronize;
 	dma_dev->dev = &pdev->dev;
 	dma_dev->chancnt = 1;
 	dma_dev->src_addr_widths = BIT(dmac->chan.src_width);
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] dmaengine: Add transfer termination synchronization support Lars-Peter Clausen <lars@metafoo.de> - 2015-10-20 11:50 +0200
  [PATCH 4/4] ALSA: pcm_dmaengine: Properly synchronize DMA on shutdown Lars-Peter Clausen <lars@metafoo.de> - 2015-10-20 11:50 +0200
    Re: [PATCH 4/4] ALSA: pcm_dmaengine: Properly synchronize DMA on shutdown Takashi Iwai <tiwai@suse.de> - 2015-10-20 13:20 +0200
      Re: [PATCH 4/4] ALSA: pcm_dmaengine: Properly synchronize DMA on  shutdown Lars-Peter Clausen <lars@metafoo.de> - 2015-10-20 13:50 +0200
        Re: [PATCH 4/4] ALSA: pcm_dmaengine: Properly synchronize DMA on shutdown Takashi Iwai <tiwai@suse.de> - 2015-10-20 14:40 +0200
        Re: [PATCH 4/4] ALSA: pcm_dmaengine: Properly synchronize DMA on  shutdown Lars-Peter Clausen <lars@metafoo.de> - 2015-10-20 15:10 +0200
  [PATCH 2/4] dmaengine: virt-dma: Add synchronization helper function Lars-Peter Clausen <lars@metafoo.de> - 2015-10-20 11:50 +0200
  [PATCH 1/4] dmaengine: Add transfer termination synchronization support Lars-Peter Clausen <lars@metafoo.de> - 2015-10-20 11:50 +0200
    Re: [PATCH 1/4] dmaengine: Add transfer termination synchronization support Andy Shevchenko <andy.shevchenko@gmail.com> - 2015-10-29 23:10 +0100
      Re: [PATCH 1/4] dmaengine: Add transfer termination synchronization  support Lars-Peter Clausen <lars@metafoo.de> - 2015-10-30 15:20 +0100
  [PATCH 3/4] dmaengine: axi_dmac: Add synchronization support Lars-Peter Clausen <lars@metafoo.de> - 2015-10-20 11:50 +0200
  Re: [PATCH 0/4] dmaengine: Add transfer termination synchronization  support Vinod Koul <vinod.koul@intel.com> - 2015-10-29 02:30 +0100

csiph-web