Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752466AbcKYF0h (ORCPT ); Fri, 25 Nov 2016 00:26:37 -0500 Received: from mga01.intel.com ([192.55.52.88]:52164 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751237AbcKYF0a (ORCPT ); Fri, 25 Nov 2016 00:26:30 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,693,1473145200"; d="scan'208";a="1090179710" Date: Fri, 25 Nov 2016 11:06:04 +0530 From: Vinod Koul To: Nandor Han Cc: Dan Williams , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Senna Tschudin , Marek Vasut Subject: Re: [PATCH 1/1] dmaengine: imx-sdma - correct the dma transfer residue calculation Message-ID: <20161125053604.GD2698@localhost> References: <0ee9c1d80055ce97cf6cdcc4aa2ce38b293547b7.1476172445.git.nandor.han@ge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0ee9c1d80055ce97cf6cdcc4aa2ce38b293547b7.1476172445.git.nandor.han@ge.com> 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 Content-Length: 872 Lines: 20 On Tue, Oct 11, 2016 at 02:13:41PM +0300, Nandor Han wrote: > The residue calculation was taking in consideration that dma > transaction status will be always retrieved in the dma callback > used to inform that dma transfer is complete. However this is not > the case for all subsystems that use dma. Some subsystems use a > timer to check the dma status periodically. > > Therefore the calculation was updated and residue is calculated > accordingly by a) update the residue calculation taking in > consideration the last used buffer index by using *buf_ptail* variable > and b) chn_real_count (number of bytes transferred) is initialized to > zero, when dma channel is created, to avoid using an uninitialized > value in residue calculation when dma status is checked without > waiting dma complete event. Looks to be missed earier, so applying now Thanks -- ~Vinod