diff mbox

dmaengine: jz4740: Fix non-cyclic descriptor completion

Message ID 1410098079-9152-1-git-send-email-lars@metafoo.de (mailing list archive)
State Accepted
Headers show

Commit Message

Lars-Peter Clausen Sept. 7, 2014, 1:54 p.m. UTC
We need to make sure to deqeueue the descriptor from the active list before
we call vchan_cookie_complete(). Also we need obviously only set chan->desc
to NULL after we stopped using it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
Note this need not go into stable as there are no users of non-cyclic
DMA transfers on jz4740 in stable.
---
 drivers/dma/dma-jz4740.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Vinod Koul Sept. 11, 2014, 5:25 a.m. UTC | #1
On Sun, Sep 07, 2014 at 03:54:39PM +0200, Lars-Peter Clausen wrote:
> We need to make sure to deqeueue the descriptor from the active list before
> we call vchan_cookie_complete(). Also we need obviously only set chan->desc
> to NULL after we stopped using it.

Applied, thanks
diff mbox

Patch

diff --git a/drivers/dma/dma-jz4740.c b/drivers/dma/dma-jz4740.c
index 6a9d89c..ae2ab14 100644
--- a/drivers/dma/dma-jz4740.c
+++ b/drivers/dma/dma-jz4740.c
@@ -362,8 +362,9 @@  static void jz4740_dma_chan_irq(struct jz4740_dmaengine_chan *chan)
 			vchan_cyclic_callback(&chan->desc->vdesc);
 		} else {
 			if (chan->next_sg == chan->desc->num_sgs) {
-				chan->desc = NULL;
+				list_del(&chan->desc->vdesc.node);
 				vchan_cookie_complete(&chan->desc->vdesc);
+				chan->desc = NULL;
 			}
 		}
 	}