From patchwork Tue Jun 7 17:38:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 631823 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rPQGV1WGpz9sDC for ; Wed, 8 Jun 2016 07:50:10 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b=ftK/2Gg4; dkim-atps=neutral Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3rPQGT6T2tzDqjs for ; Wed, 8 Jun 2016 07:50:09 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b=ftK/2Gg4; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3rPJjr1FXczDq64 for ; Wed, 8 Jun 2016 03:40:00 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b=ftK/2Gg4; dkim-atps=neutral Received: by mail-wm0-f54.google.com with SMTP id n184so147711040wmn.1 for ; Tue, 07 Jun 2016 10:40:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=E9dMYvg9yq2xaqJRGex8AQDYGrIO76Nv9AU48QlKZ1o=; b=ftK/2Gg4ERFn2xSKCaTEcbEmK8fPSjqKe7OuxlFbt3b+aqFMvrvdwZxqikLVWMsCgX rSCGocnPzEAd2hdqm+k1WbgoSEKmtV/oO9X1rs5w67Fa57y6wVTlWEv8PHVdy4Hs3K50 Ax0MG0Y9xD7vKn1NrHQWPIs44xn61xiXBZfUY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=E9dMYvg9yq2xaqJRGex8AQDYGrIO76Nv9AU48QlKZ1o=; b=ZQ/KbpCoD4fXwN+ss6uxSlIjy7bjHsi0E3jcSZRbJCHoDGrQ4rITDe+xOylWWtjxU3 hWubfeMXo6OkQuBwfe5a7n90IPHRf8FrYvpK1GgHussb4Wz9lZK1bGRb666GUoyLVrHm CcnO4XdcRok25UDXEvxmoTvmyN9YvZLRVKGIm63vyk3N2MKwr/RLakaaQIvcBfLnrEOF Ors9tD6uanZqpD8/XgrXCIC1PcaJOsN5E2LrudxpgnPSnDZGrd+hTGLU1v4vXbf8DVKU awBbTv/GaEkHzYVLM5leq7GBKlWYguILHEND7mZPbfXBk+QSDeFo+hfyWrujzo5XMsFi VaxA== X-Gm-Message-State: ALyK8tITDfgRoi0y6273fJnIXTRWT0fO5jp0ljY/TddQlwpzYt/dAkO7Ka9dfZzquq9g7k29 X-Received: by 10.194.97.41 with SMTP id dx9mr552752wjb.60.1465321137382; Tue, 07 Jun 2016 10:38:57 -0700 (PDT) Received: from localhost.localdomain (cpc84731-aztw28-2-0-cust112.18-1.cable.virginm.net. [82.37.67.113]) by smtp.gmail.com with ESMTPSA id h8sm1310031wjg.9.2016.06.07.10.38.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Jun 2016 10:38:56 -0700 (PDT) From: Peter Griffin To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@stlinux.com, vinod.koul@intel.com, linus.walleij@linaro.org, dan.j.williams@intel.com, leoli@freescale.com, zw@zh-kernel.org, baohua@kernel.org, maxime.ripard@free-electrons.com, wens@csie.org, ldewangan@nvidia.com, jonathanh@nvidia.com, swarren@wwwdotorg.org, thierry.reding@gmail.com, gnurou@gmail.com Subject: [PATCH 7/8] dmaengine: tegra20-apb-dma: Only calculate residue if txstate exists. Date: Tue, 7 Jun 2016 18:38:40 +0100 Message-Id: <1465321121-22238-8-git-send-email-peter.griffin@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465321121-22238-1-git-send-email-peter.griffin@linaro.org> References: <1465321121-22238-1-git-send-email-peter.griffin@linaro.org> X-Mailman-Approved-At: Wed, 08 Jun 2016 07:37:26 +1000 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.griffin@linaro.org, dmaengine@vger.kernel.org, linux-tegra@vger.kernel.org, lee.jones@linaro.org, linuxppc-dev@lists.ozlabs.org MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" There is no point calculating the residue if there is no txstate to store the value. Signed-off-by: Peter Griffin --- drivers/dma/tegra20-apb-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c index 01e316f..7f4af8c 100644 --- a/drivers/dma/tegra20-apb-dma.c +++ b/drivers/dma/tegra20-apb-dma.c @@ -814,7 +814,7 @@ static enum dma_status tegra_dma_tx_status(struct dma_chan *dc, unsigned int residual; ret = dma_cookie_status(dc, cookie, txstate); - if (ret == DMA_COMPLETE) + if (ret == DMA_COMPLETE || !txstate) return ret; spin_lock_irqsave(&tdc->lock, flags);