From patchwork Sun Sep 20 19:11:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: hamzahfrq.sub@gmail.com X-Patchwork-Id: 7226551 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 94594BEEC1 for ; Sun, 20 Sep 2015 19:11:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BEBE420673 for ; Sun, 20 Sep 2015 19:11:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EF2602068F for ; Sun, 20 Sep 2015 19:11:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755468AbbITTLQ (ORCPT ); Sun, 20 Sep 2015 15:11:16 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:37287 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755485AbbITTLQ (ORCPT ); Sun, 20 Sep 2015 15:11:16 -0400 Received: by wicfx3 with SMTP id fx3so85833108wic.0; Sun, 20 Sep 2015 12:11:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=HCO5YIqA8/XtOcGI1OBmFn0wkwunlsvj2C+MSOHj2C8=; b=qNz8g5wEZObEjSiVmHwjPDsz54PtmJkhaWGs/LoIgx73O6oebQJRBdjQA03BC0d+6f P9acN+iaZ4dAbKJK3LfOZTy72BimTr+MQkLl/KioAfHtb+NyGTNerTXaXP+O6pXYfiWg lop9H2Ia1KizaHfgdNBiqeRgN+XMUZquJ2h5fBinigyXfxhn8+m4yRZ0VrEtioTdjqXA 7L0L1+Xf8XZCX5fLf1VQwEi1d37nRrjyt9xcBLk/rBeOna2zz5H45z7kDdmsgtH1iGhe hJMLvPPT19lN4OiVQ+J9qYBtaLyU2/pTCBrIcAE9xY3sP1O6eAH9EWmpH8hKTaR6N8v1 XIUg== X-Received: by 10.194.24.233 with SMTP id x9mr18928239wjf.20.1442776275010; Sun, 20 Sep 2015 12:11:15 -0700 (PDT) Received: from ubuntu-VirtualBox.fritz.box (p4FDCDB66.dip0.t-ipconnect.de. [79.220.219.102]) by smtp.googlemail.com with ESMTPSA id fz1sm9644738wic.8.2015.09.20.12.11.13 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 20 Sep 2015 12:11:14 -0700 (PDT) From: hamzahfrq.sub@gmail.com To: laurent.pinchart@ideasonboard.com Cc: dmaengine@vger.kernel.org, j@bitron.ch, joe@perches.com, kuninori.morimoto.gx@renesas.com, broonie@kernel.org, geert+renesas@glider.be, vinod.koul@intel.com, linux-sh@vger.kernel.org, Muhammad Hamza Farooq Subject: [RESEND PATCH 4/6] dma: rcar-dma: use result of updated get_residue in tx_status Date: Sun, 20 Sep 2015 21:11:00 +0200 Message-Id: <1442776262-2503-5-git-send-email-hamzahfrq.sub@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Muhammad Hamza Farooq Signed-off-by: Muhammad Hamza Farooq --- drivers/dma/sh/rcar-dmac.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c index 668fd2b..ce21575 100644 --- a/drivers/dma/sh/rcar-dmac.c +++ b/drivers/dma/sh/rcar-dmac.c @@ -1258,6 +1258,10 @@ static enum dma_status rcar_dmac_tx_status(struct dma_chan *chan, residue = rcar_dmac_chan_get_residue(rchan, cookie); spin_unlock_irqrestore(&rchan->lock, flags); + /* if there's no residue, the cookie is complete */ + if (!residue) + return DMA_COMPLETE; + dma_set_residue(txstate, residue); return status;