From patchwork Mon Oct 16 05:28:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10007671 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D9B0F601D5 for ; Mon, 16 Oct 2017 05:28:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE82A27BFF for ; Mon, 16 Oct 2017 05:28:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C34B227C0B; Mon, 16 Oct 2017 05:28:56 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham 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 DDAF927BFF for ; Mon, 16 Oct 2017 05:28:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750794AbdJPF2z (ORCPT ); Mon, 16 Oct 2017 01:28:55 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:12509 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751818AbdJPF2x (ORCPT ); Mon, 16 Oct 2017 01:28:53 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie2.idc.renesas.com with ESMTP; 16 Oct 2017 14:28:51 +0900 Received: from relmlii1.idc.renesas.com (relmlii1.idc.renesas.com [10.200.68.65]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id DCC5A62507; Mon, 16 Oct 2017 14:28:51 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.43,385,1503327600"; d="scan'208";a="259492772" Received: from mail-sg2apc01lp0240.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.240]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 16 Oct 2017 14:28:50 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=tE0bdKhz1tszFQUqIqkDx4+oY5SZmwR+fVHCFE/RUs4=; b=Fvpi6ALdLXOkL2BCTk2V+aeFkXfr1oIEW/x1ivDzKs0GLwUUvMZhR748xSoW8CMceorcqmO1kP8xFHJyYyJfJNfNoyLNdlPvQ49MsYTAUPUc2sWCmcXyTnp6p8VK3XzdqhKcXXYBqR/elN7MZvOP0WDBAHVUS6hQ6eE9i0qiEsI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.138) by KL1PR0601MB1878.apcprd06.prod.outlook.com (2603:1096:802:7::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Mon, 16 Oct 2017 05:28:47 +0000 Message-ID: <87h8uzmzx2.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH] dmaengine: rcar-dmac: read DMATCRB instead of DMATCR for residue User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Dan Williams , Vinod Koul , Laurent Pinchart Cc: =?ISO-8859-1?Q?=22Niklas_S=F6derlund=22?= , Geert Uytterhoeven , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Hiroyuki Yokoyama MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Mon, 16 Oct 2017 05:28:47 +0000 X-Originating-IP: [211.11.155.138] X-ClientProxiedBy: KL1PR0601CA0020.apcprd06.prod.outlook.com (2603:1096:802:1::30) To KL1PR0601MB1878.apcprd06.prod.outlook.com (2603:1096:802:7::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b0c2d697-9da3-4853-80fa-08d51456c730 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:KL1PR0601MB1878; X-Microsoft-Exchange-Diagnostics: 1; KL1PR0601MB1878; 3:ipr7fSVZoal2deQGLNOMYV3omtZzJHSiHqHiQ+n6aVQgVwsH9uzswgIo9jx7kihedFaZ0GjIhx9TAIhTr9EzZ1+tKEmZuO1TDp8f81PEsMXDBYweFt7YQS+sY9fqCY44WGYs2u6GX+LyNj/l6IkW1C7PejP2Ziph9WXbsGA99z+t6JQ98xv62HqSt3juNj8gMeJ46p8uBvh8G6Z36jELEtNbtFIt1yMYbUZyUX4Dr8VkZe6lapJTkzvfGLP2dqh7; 25:48Agu0lmNP3qZBCOXcg1flXai4NMSFH2PEv6kz5qhDPh6e+9S5sVU5YFU1t/p/GiVD9qK3ZOvOl5qQZNktRxPDiszrSuKac5ml5BqtvPkqB/FOp59B5eWtdDz6n1ou05vqzFMBcaO2maI9mchHr4ZELver+QtnVKAoftYkeCd2n+Bh5uKxHqVkFasMvsxckNiF/O8KLScRQvCYO6vBAid7HPoD8ClnTwUX09w1pH25lWxOl/fyAH9dH8IQWhWJD4a7+rWk2tYLGx1BnP3t2wxYOog7LkFZw615DS0j5jtbsGudLoC1myOXTFlOJ/2O2rhIZOyQTcxUUNBRgECcWReA==; 31:rklP2SGueGT/2TjF9PrOvt8l08viogHP9RWXKNI2A2pZ8iB3u+Cz5FkOm2qwVncWvg+61o2b9dT4I0wQbCTWvrSBYeEWKzVnkj/RXt1n6MQBc2yqJw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:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:KL1PR0601MB1878; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:KL1PR0601MB1878; X-Forefront-PRVS: 0462918D61 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(39860400002)(346002)(376002)(189002)(199003)(6116002)(23726003)(3846002)(16526018)(50466002)(33646002)(107886003)(16586007)(53936002)(54356999)(4326008)(101416001)(83506001)(97736004)(53416004)(5660300001)(69596002)(68736007)(81156014)(81166006)(8676002)(8936002)(86362001)(478600001)(2906002)(36756003)(189998001)(66066001)(47776003)(54906003)(58126008)(50986999)(305945005)(106356001)(25786009)(316002)(6486002)(110136005)(105586002)(7736002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:KL1PR0601MB1878; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: renesas.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; KL1PR0601MB1878; 23:xmLTJNqUrNDida+pYsfum173X1NUlNXHX+netyG?= =?us-ascii?Q?AMWjUvqtLzxwQYZuwzV6Tqi+9ed6SYKeJAxu0sjAZzX4g6vlWaRkGnf9PgGc?= =?us-ascii?Q?1R9ouFqt59QQ7zT3Uj1/yBwic5CPHE/q6hPDhclnyMgY21cAR8PixqFt1LfE?= =?us-ascii?Q?CT4mJWH1sPrcmz0SdwZfQfPi+dgYIfmnmLrjDV6+e6Suknh/5ng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IEl2/sdQR9Jfq+dPgYXmNEaIg5eZEf4bLSAwV7UC6++ZQcarL?= =?us-ascii?Q?hCoVYyz44NgI=3D?= X-Microsoft-Exchange-Diagnostics: 1; KL1PR0601MB1878; 6:yUqmaMVKso0smJQdbbNPXd/yDtJnZnHPX8V5Q60AL023LpUdpmYI310cETa93i1+/oh/qpDafLr48SdxE2Lsq45kyFq/ce+vtntPiGGknWpLMXu+h9FbIogHbOZR6XAKMFQbs0EbaCI6GsBA5X/Hp9whrZQj61bKDW4sE80dkX3ZpxmKebX7/nBi1N5B8zAmNs0/lzZ+WoSQiNeddM5niNou2zkFLGoE1ByGvmHWpCnCCjqokvuhiRYw+xvErhVm2xY/lXpamQ+c3n3FHIArhYGWh0QdZh/cFchRKI00eXfVm61pwdAS+sepNgRYq0MQVSxQm8wQls6UcM2MxUh88w==; 5:Axv/B2NSKpAdnb59ExliGcBSJC7OFs5ks9thncdG0+PJQhqjRIaVII3qJ5JvlKQPAeq/B2xA0aoqAw6lYuz5AbKXU/Gr6P3rVcMQYPixfSZ4w/T4XFhGPrWiff7ZnEMcaAeyCXzAqbtof+pJGNdUYA==; 24:c2h8KeCQyKs/32GA6NIjizEUzvvZY41CgXVdc+5hvsXYoPR+snvWDz3O/zk489jV5hZnQxwNAbra/djckqF0fva5ImWIg9QN0G407PApRuA=; 7:tbLwKTkMp/ywRLNj59OygdTodNCUbptVCak4awTGvOmDZ2XVXwB1O/M9U4HR/Rri/vv8gldSKrZkdUp5cLu3Ox37Mb3IDaEgCk73wR2AlE7v7kTv4MdiSBw8JY5IGXMnFfu3g80q5oqfcU97APoiE0YAvYCzTBetzeJu1ltKck/YTSTFQ0kykt+PnjrfdX2RKTkh/JsmVyLfx1T3nHTh+f/IZ4mbzIMmUGXxYKTOnXM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; KL1PR0601MB1878; 20:XhX/JIUh/WSj/BMNVpHK96ZDiYfPt/59qEeoEryO5agMyn/TyM4zvihRVodZ6hugOhtIhp/6Tc5MM8SPkukX+/vjTntwapsiBctPE3nuO/n9oNLYnREhePyjfaaqNF+b1eux0FfZbHMAhCYEIEeZxeXhyRDCmrqwHRRNAmH6eyY= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2017 05:28:47.4224 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR0601MB1878 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto SYS/RT/Audio DMAC have both TCR/TCRB register. Its difference is transfer counter value of read (= TCR) or write (= TCRB). The relationship is like below. TCR TCRB [SOURCE] -> [DMAC] -> [DESTINATION] Thus, we want to read TCRB instead of TCR for residue. Otherwise, Sound Capture has noise after PluseAudio support (= 07b7acb51d2 ("ASoC: rsnd: update pointer more accurate")) Signed-off-by: Hiroyuki Yokoyama [Kuninori: added detail information in log] Signed-off-by: Kuninori Morimoto --- 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 2b2c7db..50c4950 100644 --- a/drivers/dma/sh/rcar-dmac.c +++ b/drivers/dma/sh/rcar-dmac.c @@ -1310,7 +1310,7 @@ static unsigned int rcar_dmac_chan_get_residue(struct rcar_dmac_chan *chan, } /* Add the residue for the current chunk. */ - residue += rcar_dmac_chan_read(chan, RCAR_DMATCR) << desc->xfer_shift; + residue += rcar_dmac_chan_read(chan, RCAR_DMATCRB) << desc->xfer_shift; return residue; }