Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1188481imj; Thu, 14 Feb 2019 02:40:09 -0800 (PST) X-Google-Smtp-Source: AHgI3IbcxOoOwibrVlbcaA3TjGSQD7NG6hQViLgc/Eur2llyaXiMdmJxKeQrkcK8kHsJeeW8Umcu X-Received: by 2002:a63:e447:: with SMTP id i7mr3123995pgk.70.1550140809834; Thu, 14 Feb 2019 02:40:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550140809; cv=none; d=google.com; s=arc-20160816; b=VvW8jIgmm/nBB7Z5T9bY2HCYvu5Zt3rDCyvjdQgExrXeNmJdqSU6aIIhyosAWMM99a sLUgbZwAX1IJLHqYY93CoWpjnmtmE240FIBvDZ8n8Majxr8Lye/V08LSorrSf5sOtyFe f0FPkusrvPNxEHC4JyHXSDL3xDoScUK9DJ690RPUqncCTNCa9WUDuUR+8zLodtIkzHPf glTWpzJiPhN+45DI3vK29vTIqfxJ/NSjbN2LOy+6CDO0XCLMbtUuZH07FgiBE2G0hxzG dQkdRRyT0qK/7rmnLq4qW6Af23iGdVRNoHd8RgDp+ltJAFHTUgKb2EHWqO/pMxGVy3sz nVzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id; bh=wqtk9m+kpQBEjV85ylkHH+A7RP8P59OHnuaa+n/L7Cc=; b=rxhMMSU9jlXh06W5W26BKmdBTJ931KRELuw30WVQHyD2CQ001Bbh+QnX322BRwk3GG 6lkPdpvuM2YjolM8ibji2bxa5ES46wfCsKJxaepiWH5WH42b85u+e9aqQ62N1yFeRoMO /9o54xGl3kerx8RaRtXanrtuWFI83LbkonUVyuDqp6iK9zJFH+ifvtrwdgG7u3Zro+y5 wu9XZgNRfirjA9fx+kTN+ptsihnKWLvbt9M8EMpzgGUdKb55Up7ej/4JSGyTbk1VhF2E PtU0Z8U1k4h9GxfvnEt7iehPleQx/lEzBq4B8DAR5b68XNouUgnzKH9WkWXAea595Nna oC2A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si2157563pln.155.2019.02.14.02.39.53; Thu, 14 Feb 2019 02:40:09 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394179AbfBNCpG (ORCPT + 99 others); Wed, 13 Feb 2019 21:45:06 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:29663 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2388490AbfBNCpG (ORCPT ); Wed, 13 Feb 2019 21:45:06 -0500 X-UUID: feeb73da9c024d11a7a5ab6c9aa5cec3-20190214 X-UUID: feeb73da9c024d11a7a5ab6c9aa5cec3-20190214 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1888075440; Thu, 14 Feb 2019 10:44:58 +0800 Received: from MTKCAS32.mediatek.inc (172.27.4.184) by mtkmbs03n1.mediatek.inc (172.21.101.181) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 14 Feb 2019 10:44:57 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS32.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 14 Feb 2019 10:44:56 +0800 Message-ID: <1550112296.7678.5.camel@mhfsdcap03> Subject: Re: [PATCH v10 1/3] dmaengine: 8250_mtk_dma: add MediaTek uart DMA support From: Long Cheng To: Vinod Koul CC: Randy Dunlap , Rob Herring , Mark Rutland , Ryder Lee , Sean Wang , Nicolas Boichat , Matthias Brugger , Dan Williams , Greg Kroah-Hartman , Jiri Slaby , Sean Wang , , , , , , , , Yingjoe Chen , YT Shen , Zhenbao Liu , Long Cheng Date: Thu, 14 Feb 2019 10:44:56 +0800 In-Reply-To: <20190204072154.GJ4296@vkoul-mobl> References: <1547781016-890-1-git-send-email-long.cheng@mediatek.com> <1547781016-890-2-git-send-email-long.cheng@mediatek.com> <20190204072154.GJ4296@vkoul-mobl> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2019-02-04 at 12:51 +0530, Vinod Koul wrote: Hi Vinod sir, > On 18-01-19, 11:10, Long Cheng wrote: > > +static enum dma_status mtk_uart_apdma_tx_status(struct dma_chan *chan, > > + dma_cookie_t cookie, > > + struct dma_tx_state *txstate) > > +{ > > + struct mtk_chan *c = to_mtk_uart_apdma_chan(chan); > > + enum dma_status ret; > > + unsigned long flags; > > + > > + if (!txstate) > > + return DMA_ERROR; > > Why, it is not a mandatory arg! Next version, I will remove it. > > > + ret = dma_cookie_status(chan, cookie, txstate); > > + spin_lock_irqsave(&c->vc.lock, flags); > > + if (ret == DMA_IN_PROGRESS) { > > + c->rx_status = mtk_uart_apdma_read(c, VFF_RPT) & VFF_RING_SIZE; > > + dma_set_residue(txstate, c->rx_status); > > + } else if (ret == DMA_COMPLETE && c->dir == DMA_DEV_TO_MEM) { > > + dma_set_residue(txstate, c->rx_status); > > what is the point is setting residue to comleted txn, it is zero! > > > + } else { > > + dma_set_residue(txstate, 0); > > naah that doesnt sound correct! > Next version, I will modify the function. > > +static void mtk_uart_apdma_config_write(struct dma_chan *chan, > > + struct dma_slave_config *cfg, > > + enum dma_transfer_direction dir) > > +{ > > + struct mtk_chan *c = to_mtk_uart_apdma_chan(chan); > > + struct mtk_uart_apdmadev *mtkd = > > + to_mtk_uart_apdma_dev(c->vc.chan.device); > > + unsigned int tmp; > > + > > + if (mtk_uart_apdma_read(c, VFF_EN) == VFF_EN_B) > > + return; > > + > > + c->dir = dir; > > + > > + if (dir == DMA_DEV_TO_MEM) { > > + tmp = cfg->src_addr_width * 1024; > > why multiply by 1024? > Next version, I will modify the this, with 'src_port_window_size' && 'dst_port_window_size'. > > +static int mtk_uart_apdma_device_pause(struct dma_chan *chan) > > +{ > > + /* just for check caps pass */ > > + return 0; > > +} > > please remove, this is not a mandatory fn Can't remove it. Before the mail, i had explained it. in 8250 uart framework, will check the function.. thanks.