From patchwork Tue Mar 5 05:56:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Behme X-Patchwork-Id: 10839055 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 15F47180E for ; Tue, 5 Mar 2019 05:56:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 063762BE2C for ; Tue, 5 Mar 2019 05:56:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE8DA2BE31; Tue, 5 Mar 2019 05:56:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66D202BE2D for ; Tue, 5 Mar 2019 05:56:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726200AbfCEF4f (ORCPT ); Tue, 5 Mar 2019 00:56:35 -0500 Received: from de-out1.bosch-org.com ([139.15.230.186]:52152 "EHLO de-out1.bosch-org.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726026AbfCEF4f (ORCPT ); Tue, 5 Mar 2019 00:56:35 -0500 Received: from si0vm1947.rbesz01.com (unknown [139.15.230.188]) by si0vms0217.rbdmz01.com (Postfix) with ESMTPS id 44D5k90ybDz4f3kZ2; Tue, 5 Mar 2019 06:56:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=de.bosch.com; s=2015-01-21; t=1551765393; bh=NJEzbVtRLgM7qYE9X5B0j8kwymv1uaTDWBadZxvwBis=; l=10; h=From:From:Reply-To:Sender; b=dMWSHP4jO9XTBPMCwxg5p4MDCTGBWm4kb70u41KOscP8yoj0YXJ+gS9SeIQWKxjqq d09vuRcKyzXvJoTjtSsLlNQt3cvcie3TgIX7pgWBaBXfaBN1D5jFSqTWlw5RNoBDqX Ta+iWDREELVr6QaeX/bmtvfkTkA5Rh0SkoNT6fqE= Received: from fe0vm1740.rbesz01.com (unknown [10.58.172.176]) by si0vm1947.rbesz01.com (Postfix) with ESMTPS id 44D5k90WyXz6CjQfJ; Tue, 5 Mar 2019 06:56:33 +0100 (CET) X-AuditID: 0a3aad14-3dbff70000000792-42-5c7e0f9051ba Received: from fe0vm1652.rbesz01.com ( [10.58.173.29]) (using TLS with cipher AES128-SHA (128/128 bits)) (Client did not present a certificate) by fe0vm1740.rbesz01.com (SMG Outbound) with SMTP id 60.EC.01938.09F0E7C5; Tue, 5 Mar 2019 06:56:32 +0100 (CET) Received: from SI-HUB2000.de.bosch.com (si-hub2000.de.bosch.com [10.4.103.108]) by fe0vm1652.rbesz01.com (Postfix) with ESMTPS id 44D5k85RJXzQ2v; Tue, 5 Mar 2019 06:56:32 +0100 (CET) Received: from HI-Z0EVG.hi.de.bosch.com (10.34.218.219) by SI-HUB2000.de.bosch.com (10.4.103.108) with Microsoft SMTP Server id 15.1.1713.5; Tue, 5 Mar 2019 06:56:32 +0100 From: Dirk Behme To: CC: , , , , , , , Hiroyuki Yokoyama , Subject: [PATCH v2 1/2] dmaengine: sh: rcar-dmac: With cyclic DMA residue 0 is valid Date: Tue, 5 Mar 2019 06:56:27 +0100 Message-ID: <20190305055628.11826-1-dirk.behme@de.bosch.com> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Originating-IP: [10.34.218.219] X-Brightmail-Tracker: H4sIAAAAAAAAA22Sf0wTZxjHeX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vd3P7u97d5eoWLwwuXe5Lc3Zu8aXD5asI+d71Efa+zDyI7MHDgeaFD/8dbQ Q1tA5rJ0tDz1WtPIqdjDm98bDqr60//tgNKWhEuXXHHb7RfbjrQ6+u5ey+173WOj1Ve1682r +K+9aT8ljvJr02/tzzlxhZYLBjZrDcYL7H/ol6MacAQAAA== Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Having a cyclic DMA, a residue 0 is not an indication of a completed DMA. In case of cyclic DMA make sure that dma_set_residue() is called and with this a residue of 0 is forwarded correctly to the caller. Fixes: 3544d2878817 ("dmaengine: rcar-dmac: use result of updated get_residue in tx_status") Signed-off-by: Dirk Behme Signed-off-by: Achim Dahlhoff Signed-off-by: Hiroyuki Yokoyama Cc: # v4.8+ --- Note: Patch done against mainline v5.0 Changes in v2: None drivers/dma/sh/rcar-dmac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c index 2b4f25698169..2ea59229d7f5 100644 --- a/drivers/dma/sh/rcar-dmac.c +++ b/drivers/dma/sh/rcar-dmac.c @@ -1378,7 +1378,7 @@ static enum dma_status rcar_dmac_tx_status(struct dma_chan *chan, spin_unlock_irqrestore(&rchan->lock, flags); /* if there's no residue, the cookie is complete */ - if (!residue) + if (!residue && !rchan->desc.running->cyclic) return DMA_COMPLETE; dma_set_residue(txstate, residue);