Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1097899imm; Tue, 3 Jul 2018 05:35:39 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcjO1aD736fZUSJBd5gY9UrRzxC6kJhki2SLgKBJqRax+fFO2YJLcs422lX+CbYbQR00Ibc X-Received: by 2002:a62:e18:: with SMTP id w24-v6mr581249pfi.145.1530621339349; Tue, 03 Jul 2018 05:35:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530621339; cv=none; d=google.com; s=arc-20160816; b=BbijbU9aPLout0n99OFi0yKiYjKpg6sESZ3XtQHM8mYxuZ0W5SNCcfpgGBYVaKw04u FmUfUCdx8/8VyRhObVJ9czbq3RZEzbrft2Bwq3pqI+WwGyB5wuabSHnxk0/7M63YbYC0 fxJeMd2nA7FXMjtqOkJvXqaXioJfsFLXpzcWlZHuZBZubp/n1gJ9SiSbrjepEEny1fQK VHYgwgSq0l92bmVs1nStSvt+72HyZqKOj1twQursaZJlMAuP2YpckAYfXppOSrGEECYR 69F25Z1J9bHlxH/w3YFn11tSc5bLhGzIi4ee4hogmLCmyWZBWPmzaRKuCQWKZXmAzf6+ R5yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=sYDEgeKKxOk+5BGS6A3CGGrzNNG31XNMEMeBXx46htw=; b=r8CFdO7BYD0W3r1zfGeAATbgzhvHcY4fDTWCo8F2Bs3eGnVx8EzXYnuNzqmtKhxD5W NBxePiLhaqWaZmtocCv8WvUOeXRiyxWKl2A5OzMocxuSkn7YjPb5Ylk3HB73PYjZ8l6d t80uRkt1oXD6LbqUWO2/UcQRWSQy+gbMfyMLH0DNq2Qa4gR+VrCtZOyYA5qhyb8P0He7 g1IUEFy0FQNtiIHSK53NZ5db34wX+HqCiDPRNCGaw3/exctI6aYU6KArBhT61ncPF0q0 jdAsasuRT5lNH76KjQQ7rgC41nY5hjq2aI1O130mDO2CknMwReJ+LgxJyejncYU9iiRr 0C/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=qVEhTXo5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x10-v6si1025189plv.1.2018.07.03.05.35.24; Tue, 03 Jul 2018 05:35:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=qVEhTXo5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932155AbeGCMcl (ORCPT + 99 others); Tue, 3 Jul 2018 08:32:41 -0400 Received: from outils.crapouillou.net ([89.234.176.41]:47020 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753388AbeGCMcj (ORCPT ); Tue, 3 Jul 2018 08:32:39 -0400 From: Paul Cercueil To: Vinod Koul , Rob Herring , Mark Rutland , Ralf Baechle , Paul Burton , James Hogan , Zubair Lutfullah Kakakhel Cc: Mathieu Malaterre , Daniel Silsby , dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org Subject: [PATCH 08/14] dmaengine: dma-jz4780: Add missing residue DTC mask Date: Tue, 3 Jul 2018 14:32:08 +0200 Message-Id: <20180703123214.23090-9-paul@crapouillou.net> In-Reply-To: <20180703123214.23090-1-paul@crapouillou.net> References: <20180703123214.23090-1-paul@crapouillou.net> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1530621157; bh=sYDEgeKKxOk+5BGS6A3CGGrzNNG31XNMEMeBXx46htw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=qVEhTXo54W+B8lq2xgmac43Ad3HXkEiHtAethyMctUTZNNBujzy7or9Wy42i9lFbPtEQ4yLgRpHEh/IU6xC+oE0bTQnXvut8MbwCXNNG8hxq+FFGkN57sogd+v7Wl18pX4MZmW8JwvUpTW83HvM6SVtJMJYCBKbRnrlORO0goGw= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Daniel Silsby The 'dtc' word in jz DMA descriptors contains two fields: The lowest 24 bits are the transfer count, and upper 8 bits are the DOA offset to next descriptor. The upper 8 bits are now correctly masked off when computing residue in jz4780_dma_desc_residue(). Note that reads of the DTCn hardware reg are automatically masked this way. Signed-off-by: Daniel Silsby --- drivers/dma/dma-jz4780.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/dma/dma-jz4780.c b/drivers/dma/dma-jz4780.c index 7ee2c121948f..7b2e305e28fb 100644 --- a/drivers/dma/dma-jz4780.c +++ b/drivers/dma/dma-jz4780.c @@ -610,7 +610,8 @@ static size_t jz4780_dma_desc_residue(struct jz4780_dma_chan *jzchan, residue = 0; for (i = next_sg; i < desc->count; i++) - residue += desc->desc[i].dtc << jzchan->transfer_shift; + residue += (desc->desc[i].dtc & 0xffffff) << + jzchan->transfer_shift; if (next_sg != 0) { count = jz4780_dma_chn_readl(jzdma, jzchan->id, -- 2.18.0