Return-Path: Received: from userp1040.oracle.com ([156.151.31.81]:46957 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753014AbcBJPNm (ORCPT ); Wed, 10 Feb 2016 10:13:42 -0500 From: Sasha Levin To: stable@vger.kernel.org, stable-commits@vger.kernel.org Cc: Songjun Wu , Ludovic Desroches , Vinod Koul , Sasha Levin Subject: [added to the 4.1 stable tree] dmaengine: at_xdmac: fix resume for cyclic transfers Date: Wed, 10 Feb 2016 10:10:19 -0500 Message-Id: <1455117136-28870-115-git-send-email-sasha.levin@oracle.com> In-Reply-To: <1455117136-28870-1-git-send-email-sasha.levin@oracle.com> References: <1455117136-28870-1-git-send-email-sasha.levin@oracle.com> Sender: stable-owner@vger.kernel.org List-ID: From: Songjun Wu This patch has been added to the 4.1 stable tree. If you have any objections, please let us know. =============== [ Upstream commit 611dcadb01c89d1d3521450c05a4ded332e5a32d ] When having cyclic transfers, the channel was paused when performing suspend but was not correctly resumed. Signed-off-by: Songjun Wu Signed-off-by: Ludovic Desroches Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver") Cc: # 4.1 and later Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- 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 c89a7ab..8d8c356 100644 --- a/drivers/dma/at_xdmac.c +++ b/drivers/dma/at_xdmac.c @@ -1230,6 +1230,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); @@ -1362,6 +1363,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