From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1945972AbcHRJQ3 (ORCPT ); Thu, 18 Aug 2016 05:16:29 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:52374 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753655AbcHRJQ1 (ORCPT ); Thu, 18 Aug 2016 05:16:27 -0400 Date: Thu, 18 Aug 2016 10:16:03 +0100 From: Russell King - ARM Linux To: Yuan Yao Cc: vinod.koul@intel.com, robh+dt@kernel.org, dan.j.williams@intel.com, mark.rutland@arm.com, shawnguo@kernel.org, leoyang.li@nxp.com, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Yuan Yao Subject: Re: [PATCH v1 1/5] dma: Add QorIQ qDMA engine driver support Message-ID: <20160818091603.GT1041@n2100.armlinux.org.uk> References: <1471502328-28305-1-git-send-email-yao.yuan@freescale.com> <1471502328-28305-2-git-send-email-yao.yuan@freescale.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1471502328-28305-2-git-send-email-yao.yuan@freescale.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 18, 2016 at 02:38:44PM +0800, Yuan Yao wrote: > + spin_lock(&fsl_comp->qchan->vchan.lock); > + if (status == DMA_COMPLETE) > + vchan_cookie_complete(&fsl_comp->vdesc); > + fsl_comp->qchan->status = status; This is buggy - if the DMA has finished processing it, even if it finished in error, it must _complete_ the transaction. Completion is not the same as being successful - it means that the DMA is no longer processing the cookie. The issue here is that when the _following_ transaction completes successfully, _this_ transaction will effectively be marked as complete due to the way the cookie system works. So... to get this straight - "completion" means "I have finished processing this transaction". It does not mean "I successfully processed this transaction without any errors." -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net.