Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1401372
| From | Jiada Wang <jiada_wang@mentor.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 07/10] dma: imx-sdma: Add synchronization support |
| Date | 2016-05-16 10:40 +0200 |
| Message-ID | <rzmee-4Dx-33@gated-at.bofh.it> (permalink) |
| References | <rzmed-4Dx-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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() 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: Jiada Wang <jiada_wang@mentor.com>
---
drivers/dma/imx-sdma.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 040cbf2..0b23407 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -1408,6 +1408,13 @@ static int sdma_terminate_all(struct dma_chan *chan)
return 0;
}
+static void sdma_synchronize(struct dma_chan *chan)
+{
+ struct sdma_channel *sdmac = to_sdma_chan(chan);
+
+ tasklet_kill(&sdmac->tasklet);
+}
+
#define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1 34
#define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V2 38
#define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V3 41
@@ -1827,6 +1834,7 @@ static int sdma_probe(struct platform_device *pdev)
sdma->dma_device.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST;
sdma->dma_device.device_issue_pending = sdma_issue_pending;
sdma->dma_device.device_terminate_all = sdma_terminate_all;
+ sdma->dma_device.device_synchronize = sdma_synchronize;
sdma->dma_device.dev->dma_parms = &sdma->dma_parms;
dma_set_max_seg_size(sdma->dma_device.dev, 65535);
--
2.4.5
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v1 00/10] *** imx-sdma: misc fix *** Jiada Wang <jiada_wang@mentor.com> - 2016-05-16 10:40 +0200 [PATCH 06/10] dma: imx-sdma: add terminate_all support Jiada Wang <jiada_wang@mentor.com> - 2016-05-16 10:40 +0200 [PATCH 02/10] dma: imx-sdma: don't update BD in isr routine Jiada Wang <jiada_wang@mentor.com> - 2016-05-16 10:40 +0200 [PATCH 08/10] dma: imx-sdma: abort updating channel when it has been terminated Jiada Wang <jiada_wang@mentor.com> - 2016-05-16 10:40 +0200 [PATCH 10/10] dma: imx-sdma: clear channel0 interrupt bit in irq routine Jiada Wang <jiada_wang@mentor.com> - 2016-05-16 10:40 +0200 [PATCH 07/10] dma: imx-sdma: Add synchronization support Jiada Wang <jiada_wang@mentor.com> - 2016-05-16 10:40 +0200 [PATCH 01/10] dma: imx-sdma: use chn_real_count to report residue for UART Jiada Wang <jiada_wang@mentor.com> - 2016-05-16 10:50 +0200 [PATCH 05/10] dma: imx-sdma: add flag to indicate SDMA channel state Jiada Wang <jiada_wang@mentor.com> - 2016-05-16 10:50 +0200 [PATCH 03/10] dma: imx-sdma: clear BD_RROR flag before pass it to sdma script Jiada Wang <jiada_wang@mentor.com> - 2016-05-16 10:50 +0200 Re: [PATCH v1 00/10] *** imx-sdma: misc fix *** Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> - 2016-05-16 13:10 +0200
csiph-web