Skip to contentSkip to conversation

dmaenegine: edma: allow pause/resume for non-cyclic mode

PATCH In review John Ogness 2 participants 2 messages Apr 27, 2015

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

PATCH 2/3 dmaenegine: edma: allow pause/resume for non-cyclic mode

The 8250_omap serial driver relies on dmaengine_pause() actually pausing the DMA transfer. Before this patch dmaengine_pause() is a NOP for non-cylic DMA transfers. This allowed the 8250_omap driver to read DMA buffers while the DMA was still active, resulting in lost serial data.

---
 drivers/dma/edma.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/dma/edma.c +1 -6
index bf09db7..88853af 100644
@@ -300,8 +300,7 @@ static int edma_dma_pause(struct dma_chan *chan)
 {
 	struct edma_chan *echan = to_edma_chan(chan);
 
-	/* Pause/Resume only allowed with cyclic mode */
-	if (!echan->edesc || !echan->edesc->cyclic)
+	if (!echan->edesc)
 		return -EINVAL;
 
 	edma_pause(echan->ch_num);
@@ -312,10 +311,6 @@ static int edma_dma_resume(struct dma_chan *chan)
 {
 	struct edma_chan *echan = to_edma_chan(chan);
 
-	/* Pause/Resume only allowed with cyclic mode */
-	if (!echan->edesc->cyclic)
-		return -EINVAL;
-
 	edma_resume(echan->ch_num);
 	return 0;
 }
Signature · 1 line
1.7.10.4
Acked-by on v1 2/3
#1 lore raw
Quoted 5 lines · John Ogness

The 8250_omap serial driver relies on dmaengine_pause() actually pausing the DMA transfer. Before this patch dmaengine_pause() is a NOP for non-cylic DMA transfers. This allowed the 8250_omap driver to read DMA buffers while the DMA was still active, resulting in lost serial data.

Quoted 31 lines
---
 drivers/dma/edma.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/dma/edma.c +1 -6
index bf09db7..88853af 100644
@@ -300,8 +300,7 @@ static int edma_dma_pause(struct dma_chan *chan)
 {
 	struct edma_chan *echan = to_edma_chan(chan);
 
-	/* Pause/Resume only allowed with cyclic mode */
-	if (!echan->edesc || !echan->edesc->cyclic)
+	if (!echan->edesc)
 		return -EINVAL;
 
 	edma_pause(echan->ch_num);
@@ -312,10 +311,6 @@ static int edma_dma_resume(struct dma_chan *chan)
 {
 	struct edma_chan *echan = to_edma_chan(chan);
 
-	/* Pause/Resume only allowed with cyclic mode */
-	if (!echan->edesc->cyclic)
-		return -EINVAL;
-
 	edma_resume(echan->ch_num);
 	return 0;
 }
Signature · 1 line
Péter