From patchwork Tue Feb 12 10:58:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 2127861 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 1C689DFB7B for ; Tue, 12 Feb 2013 11:01:54 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U5DZu-0002B9-4d; Tue, 12 Feb 2013 10:59:10 +0000 Received: from mga02.intel.com ([134.134.136.20]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U5DZj-0002A2-0l for linux-arm-kernel@lists.infradead.org; Tue, 12 Feb 2013 10:58:59 +0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 12 Feb 2013 02:58:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,648,1355126400"; d="scan'208";a="284628445" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.173]) by orsmga002.jf.intel.com with ESMTP; 12 Feb 2013 02:58:55 -0800 Received: from andy by smile with local (Exim 4.80) (envelope-from ) id 1U5DZS-0004xn-Rt; Tue, 12 Feb 2013 12:58:42 +0200 From: Andy Shevchenko To: Vinod Koul , linux-kernel@vger.kernel.org, Viresh Kumar Subject: [PATCH 4/6] dma: coh901318_lli: set residue only if dma is in progress Date: Tue, 12 Feb 2013 12:58:37 +0200 Message-Id: <1360666720-19006-5-git-send-email-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360666720-19006-1-git-send-email-andriy.shevchenko@linux.intel.com> References: <1360666720-19006-1-git-send-email-andriy.shevchenko@linux.intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130212_055859_162166_3C160C17 X-CRM114-Status: GOOD ( 12.20 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [134.134.136.20 listed in list.dnswl.org] -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Linus Walleij , Andy Shevchenko , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org When status is DMA_SUCCESS the residue should be zero. Otherwise it's a bug. Signed-off-by: Andy Shevchenko Cc: Linus Walleij Cc: linux-arm-kernel@lists.infradead.org Acked-by: Linus Walleij --- drivers/dma/coh901318.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/dma/coh901318.c b/drivers/dma/coh901318.c index a2f079a..797940e 100644 --- a/drivers/dma/coh901318.c +++ b/drivers/dma/coh901318.c @@ -2355,7 +2355,9 @@ coh901318_tx_status(struct dma_chan *chan, dma_cookie_t cookie, enum dma_status ret; ret = dma_cookie_status(chan, cookie, txstate); - /* FIXME: should be conditional on ret != DMA_SUCCESS? */ + if (ret == DMA_SUCCESS) + return ret; + dma_set_residue(txstate, coh901318_get_bytes_left(chan)); if (ret == DMA_IN_PROGRESS && cohc->stopped)