aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSongjun Wu <songjun.wu@atmel.com>2016-01-18 05:14:44 -0500
committerVinod Koul <vinod.koul@intel.com>2016-01-18 08:37:46 -0500
commit611dcadb01c89d1d3521450c05a4ded332e5a32d (patch)
tree9109cbbf1c148268fe94ee211d05f455ecf2fb5c
parent2895b2cad6e7a95104cf396e5330054453382ae1 (diff)
dmaengine: at_xdmac: fix resume for cyclic transfers
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 Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r--drivers/dma/at_xdmac.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c
index d0ae4613b87e..c21aef74e8d1 100644
--- a/drivers/dma/at_xdmac.c
+++ b/drivers/dma/at_xdmac.c
@@ -1697,6 +1697,7 @@ static int at_xdmac_device_terminate_all(struct dma_chan *chan)
1697 list_for_each_entry_safe(desc, _desc, &atchan->xfers_list, xfer_node) 1697 list_for_each_entry_safe(desc, _desc, &atchan->xfers_list, xfer_node)
1698 at_xdmac_remove_xfer(atchan, desc); 1698 at_xdmac_remove_xfer(atchan, desc);
1699 1699
1700 clear_bit(AT_XDMAC_CHAN_IS_PAUSED, &atchan->status);
1700 clear_bit(AT_XDMAC_CHAN_IS_CYCLIC, &atchan->status); 1701 clear_bit(AT_XDMAC_CHAN_IS_CYCLIC, &atchan->status);
1701 spin_unlock_irqrestore(&atchan->lock, flags); 1702 spin_unlock_irqrestore(&atchan->lock, flags);
1702 1703
@@ -1829,6 +1830,8 @@ static int atmel_xdmac_resume(struct device *dev)
1829 atchan = to_at_xdmac_chan(chan); 1830 atchan = to_at_xdmac_chan(chan);
1830 at_xdmac_chan_write(atchan, AT_XDMAC_CC, atchan->save_cc); 1831 at_xdmac_chan_write(atchan, AT_XDMAC_CC, atchan->save_cc);
1831 if (at_xdmac_chan_is_cyclic(atchan)) { 1832 if (at_xdmac_chan_is_cyclic(atchan)) {
1833 if (at_xdmac_chan_is_paused(atchan))
1834 at_xdmac_device_resume(chan);
1832 at_xdmac_chan_write(atchan, AT_XDMAC_CNDA, atchan->save_cnda); 1835 at_xdmac_chan_write(atchan, AT_XDMAC_CNDA, atchan->save_cnda);
1833 at_xdmac_chan_write(atchan, AT_XDMAC_CNDC, atchan->save_cndc); 1836 at_xdmac_chan_write(atchan, AT_XDMAC_CNDC, atchan->save_cndc);
1834 at_xdmac_chan_write(atchan, AT_XDMAC_CIE, atchan->save_cim); 1837 at_xdmac_chan_write(atchan, AT_XDMAC_CIE, atchan->save_cim);