From patchwork Sun Sep 7 13:54:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Peter Clausen X-Patchwork-Id: 4858621 Return-Path: X-Original-To: patchwork-dmaengine@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1BC4E9F32E for ; Sun, 7 Sep 2014 13:55:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2FE312012D for ; Sun, 7 Sep 2014 13:55:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C80E220121 for ; Sun, 7 Sep 2014 13:55:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752082AbaIGNzJ (ORCPT ); Sun, 7 Sep 2014 09:55:09 -0400 Received: from smtp-out-159.synserver.de ([212.40.185.159]:1281 "EHLO smtp-out-158.synserver.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752010AbaIGNzJ (ORCPT ); Sun, 7 Sep 2014 09:55:09 -0400 Received: (qmail 29069 invoked by uid 0); 7 Sep 2014 13:55:05 -0000 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@laprican.de X-SynServer-PPID: 28731 Received: from ppp-188-174-34-103.dynamic.mnet-online.de (HELO lars-laptop.fritz.box) [188.174.34.103] by 217.119.54.96 with SMTP; 7 Sep 2014 13:55:04 -0000 From: Lars-Peter Clausen To: Vinod Koul , Dan Williams Cc: Apelete Seketeli , dmaengine@vger.kernel.org, Lars-Peter Clausen Subject: [PATCH] dmaengine: jz4740: Fix non-cyclic descriptor completion Date: Sun, 7 Sep 2014 15:54:39 +0200 Message-Id: <1410098079-9152-1-git-send-email-lars@metafoo.de> X-Mailer: git-send-email 1.7.10.4 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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(-) 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; } } }