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


Groups > linux.kernel > #1311451 > unrolled thread

[PATCH] dmaengine: at_xdmac: fix resume for cyclic transfers

Started byLudovic Desroches <ludovic.desroches@atmel.com>
First post2016-01-18 11:20 +0100
Last post2016-01-18 14:40 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] dmaengine: at_xdmac: fix resume for cyclic transfers Ludovic Desroches <ludovic.desroches@atmel.com> - 2016-01-18 11:20 +0100
    Re: [PATCH] dmaengine: at_xdmac: fix resume for cyclic transfers Vinod Koul <vinod.koul@intel.com> - 2016-01-18 14:40 +0100

#1311451 — [PATCH] dmaengine: at_xdmac: fix resume for cyclic transfers

FromLudovic Desroches <ludovic.desroches@atmel.com>
Date2016-01-18 11:20 +0100
Subject[PATCH] dmaengine: at_xdmac: fix resume for cyclic transfers
Message-ID<qSf4J-7Fw-3@gated-at.bofh.it>
From: Songjun Wu <songjun.wu@atmel.com>

When having cyclic transfers, the channel was paused when performing
suspend but was not correctly resumed.

Signed-off-by: Songjun Wu <songjun.wu@atmel.com>
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel
eXtended DMA Controller driver")
Cc: <stable@vger.kernel.org> # 4.1 and later
---
 drivers/dma/at_xdmac.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c
index 39f5966..64f5d1b 100644
--- a/drivers/dma/at_xdmac.c
+++ b/drivers/dma/at_xdmac.c
@@ -1700,6 +1700,7 @@ static int at_xdmac_device_terminate_all(struct dma_chan *chan)
 	list_for_each_entry_safe(desc, _desc, &atchan->xfers_list, xfer_node)
 		at_xdmac_remove_xfer(atchan, desc);
 
+	clear_bit(AT_XDMAC_CHAN_IS_PAUSED, &atchan->status);
 	clear_bit(AT_XDMAC_CHAN_IS_CYCLIC, &atchan->status);
 	spin_unlock_irqrestore(&atchan->lock, flags);
 
@@ -1832,6 +1833,8 @@ static int atmel_xdmac_resume(struct device *dev)
 		atchan = to_at_xdmac_chan(chan);
 		at_xdmac_chan_write(atchan, AT_XDMAC_CC, atchan->save_cc);
 		if (at_xdmac_chan_is_cyclic(atchan)) {
+			if (at_xdmac_chan_is_paused(atchan))
+				at_xdmac_device_resume(chan);
 			at_xdmac_chan_write(atchan, AT_XDMAC_CNDA, atchan->save_cnda);
 			at_xdmac_chan_write(atchan, AT_XDMAC_CNDC, atchan->save_cndc);
 			at_xdmac_chan_write(atchan, AT_XDMAC_CIE, atchan->save_cim);
-- 
2.5.0

[toc] | [next] | [standalone]


#1311547

FromVinod Koul <vinod.koul@intel.com>
Date2016-01-18 14:40 +0100
Message-ID<qSich-1gC-7@gated-at.bofh.it>
In reply to#1311451
On Mon, Jan 18, 2016 at 11:14:44AM +0100, Ludovic Desroches wrote:
> From: Songjun Wu <songjun.wu@atmel.com>
> 
> When having cyclic transfers, the channel was paused when performing
> suspend but was not correctly resumed.

Applied, thanks

-- 
~Vinod

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web