From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753176AbbDADg7 (ORCPT ); Tue, 31 Mar 2015 23:36:59 -0400 Received: from mga09.intel.com ([134.134.136.24]:7322 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751315AbbDADg5 (ORCPT ); Tue, 31 Mar 2015 23:36:57 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,503,1422950400"; d="scan'208";a="701226075" Date: Wed, 1 Apr 2015 09:02:30 +0530 From: Vinod Koul To: Andy Gross Cc: devicetree@vger.kernel.org, dmaengine@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Kumar Gala , Bjorn Andersson Subject: Re: [Patch v6 2/2] dmaengine: Add ADM driver Message-ID: <20150401033230.GS7192@intel.com> References: <1426571172-9711-1-git-send-email-agross@codeaurora.org> <1426571172-9711-3-git-send-email-agross@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1426571172-9711-3-git-send-email-agross@codeaurora.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 17, 2015 at 12:46:12AM -0500, Andy Gross wrote: > +static enum dma_status adm_tx_status(struct dma_chan *chan, dma_cookie_t cookie, > + struct dma_tx_state *txstate) > +{ > + struct adm_chan *achan = to_adm_chan(chan); > + struct virt_dma_desc *vd; > + enum dma_status ret; > + unsigned long flags; > + size_t residue = 0; > + > + ret = dma_cookie_status(chan, cookie, txstate); > + if (ret == DMA_COMPLETE || !txstate) > + return ret; > + > + spin_lock_irqsave(&achan->vc.lock, flags); > + > + vd = vchan_find_desc(&achan->vc, cookie); > + if (vd) > + residue = container_of(vd, struct adm_async_desc, vd)->length; > + > + spin_unlock_irqrestore(&achan->vc.lock, flags); > + > + /* > + * residue is either the full length if it is in the issued list, or 0 > + * if it is in progress. We have no reliable way of determining > + * anything inbetween > + */ > + dma_set_residue(txstate, residue); > + > + if (achan->error) > + return DMA_ERROR; but this may not be for the current descriptor right, which is queued? -- ~Vinod