Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp3483128ima; Sun, 3 Feb 2019 23:25:08 -0800 (PST) X-Google-Smtp-Source: AHgI3IbBkqgfNL24UpS2jG17x61U0rZ1bTNtH1o4/sK2NUsWn8IN6VYf9+PLKFUxZdNJzj5U1yZg X-Received: by 2002:a65:4842:: with SMTP id i2mr7853953pgs.176.1549265108712; Sun, 03 Feb 2019 23:25:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549265108; cv=none; d=google.com; s=arc-20160816; b=S9u3E4G2H4NEv8UMW7su00CSWKFUfOaNPqDxPiFbAKIdqunW3Q+vpPI2lMbHnN4NxY AwpjYO0N96sjFWUFkoOLHr5h4Af9JTqJ+AeU9tZLt61A6w6jT19Gpcknk5VBk+6mwoKo nbIkryBzRfEYIr+hVPVmsCd9TooOjKH8/eMLhmPfr48Z8P1wyKXaQLROwPfxtKE+DAeU Wld506xfYT9Fr+a7sq2AbaTbQZsGbbhqjWNBIEk9Db/FvhMe0mdKyYQtgHE7ILAU84GN ZKpTAXsIghYtCaGgAMAwk4bslrO/itoOY57GKzkcEJEnMcodKqDx1u8KT4db7T4Hvq3C aCXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=fmegEQUpR3dDzQx2LdB8SON95shrLw0ufDpJgsAngPw=; b=YAA8PJlLo8q+qHz/JRAY2vkyXoNSIDzdv/6OV1jgUs3zlieN0eHpB6MhfmswoSnPVD baI5oUA7ckXOiFg/+zQnKF3z0RCyobIFcOavc7YA/jkNtE3qtlB/t8Vn5aAQCld3cgmS +MS+C6lu+zpe/DIRrHxzFUSiqbORGvVsKYLmiJlgLkduInpnRAtpnj7NAOdDGR2gbTqi lNnpZ1aWsP3qO+1seLurdyji9HLfttm1HP9RbaKpVNKjYDGvQH0d4xhbX4knc5fDD8Xo D+qQRXWcdHoVh1qPHXhjeweH9guX2IFQpOBik9VIiYfUY/jivIN9fPXJJ+A8hFYa4fUs QcXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nUKyNq6H; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y20si1969791pgi.50.2019.02.03.23.24.52; Sun, 03 Feb 2019 23:25:08 -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; dkim=pass header.i=@kernel.org header.s=default header.b=nUKyNq6H; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728024AbfBDHXX (ORCPT + 99 others); Mon, 4 Feb 2019 02:23:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:49500 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725854AbfBDHXX (ORCPT ); Mon, 4 Feb 2019 02:23:23 -0500 Received: from localhost (unknown [171.76.74.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 92B4A2083B; Mon, 4 Feb 2019 07:23:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549265002; bh=HDgwpkhTpoTEVDPKrkmykrNSqq9yCCJYhstkDTGaZWE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nUKyNq6Hts9oKpqFVbZ/mpkxPAtFK43ibh8WLBgzpsTvo7+BLeLG5N0+7brbVEffc WQAhP+A6rr5jgbzfuyTzgN6G6JdhQPfOglnHO9KqhfXhN3TKwqUlBNTOueG8khTv9Z Lrpbh+ZuDSqochHp+jcQVvER3BRaDmXY7Yb8fB4Q= Date: Mon, 4 Feb 2019 12:51:54 +0530 From: Vinod Koul To: Long Cheng Cc: Randy Dunlap , Rob Herring , Mark Rutland , Ryder Lee , Sean Wang , Nicolas Boichat , Matthias Brugger , Dan Williams , Greg Kroah-Hartman , Jiri Slaby , Sean Wang , dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, srv_heupstream@mediatek.com, Yingjoe Chen , YT Shen , Zhenbao Liu Subject: Re: [PATCH v10 1/3] dmaengine: 8250_mtk_dma: add MediaTek uart DMA support Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1547781016-890-2-git-send-email-long.cheng@mediatek.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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! > + 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! > +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? > +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 -- ~Vinod