Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4954778imu; Tue, 8 Jan 2019 09:03:02 -0800 (PST) X-Google-Smtp-Source: ALg8bN4okBckDtXnPvqhyqHEd4ejbigmEdRU1HN3xCpOzGmGIWYg3iX5ykUbtNLpysaWfQGij9Se X-Received: by 2002:a63:2e88:: with SMTP id u130mr2231694pgu.9.1546966982324; Tue, 08 Jan 2019 09:03:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546966982; cv=none; d=google.com; s=arc-20160816; b=POxiTBtqeHvH/HX4ZEBXOXvcOhiHMgHRCpfTkaDFaAiSdrMfYs8vU7gxpoYckhe8xK Yna2jiwGmGAOiF7fe0MDKQH8KdRoL+/ynOGyXm2NWY/wSayZRN0uBPLdUGXEa1DXcK7M 8KL6wGDu642gDsUeKap2W0d0+a7KQi//UDGIbgqlfShemXFlvLTGHFdmCHUohZqaN3Gz vvSG2mZcS3rLtfDkaYjIW+jBrkKWzUizM2KVx+AjgA+Rj2OajNBmBaarAp3iPcCPRhZI j/9Diy4K4Qpe7pB6/7+pHpE4oLLVcehgbT8oOi4LCTN2cUaQDi40KwiVwmA878oRPVFI NEXg== 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=U3zQYEHXW8XkdOGf+C4Wv5/MNNJRjUEE7oyCYIzL9ro=; b=cfaxpfm49+Cns3CSwmui69w1w5puSSdKRmajSraBg/rjYX/CBWQBNRLHU9bHiKoFCm 06BjCQQeED0YRlVFy9hrYPTx6+hvjTndjGcEA9P6e4QeKe1gS1TJV7FrOInWkJ0Z7zuE gIvQDhesWcGlXewUy0pvN7zQodBxXNfyDooHhpESGDRAA2mOYqQRFkiBTEQ5d1qeeCkl xluK+JMDOu+Vzm+gwWuudWNE3k8XApFACPX/MzZeWxziFNZTP6s4TIHExllSwTBT7vjw G1vAqtXeH1lECMnaWj1BfnpUXqdxE/L5qFC3b89MiHQo6LVUHAhpqNhaVv1Pfdwsg9/K lGkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qVH07tF8; 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 bh12si63270093plb.353.2019.01.08.09.02.42; Tue, 08 Jan 2019 09:03:02 -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=qVH07tF8; 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 S1729034AbfAHRBZ (ORCPT + 99 others); Tue, 8 Jan 2019 12:01:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:52712 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727484AbfAHRBY (ORCPT ); Tue, 8 Jan 2019 12:01:24 -0500 Received: from localhost (unknown [171.76.109.220]) (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 C564C20827; Tue, 8 Jan 2019 17:01:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546966883; bh=ZRtsnS+5LBwEuU4GkKiAOJXa+BwPlS5MtTkpo09pNPE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qVH07tF8I4q5dXW82bQCSPyJD92jXj539t+sMbLkGDXL8NEzHmxbiSIbZJz7pKug9 MkxkXF7uiRt02cyDPpcIiakHk/TuNSTlAr7QZqOLuYOe0zSvB7tx4+mFGChA72WOmG nJYAOaVyLBDtWO4qg/mwAC078DTWF7aBVSi5JNCg= Date: Tue, 8 Jan 2019 22:29:46 +0530 From: Vinod Koul To: "Shun-Chih.Yu" Cc: devicetree@vger.kernel.org, Sean Wang , linux-kernel@vger.kernel.org, srv_wsdupstream@mediatek.com, dmaengine@vger.kernel.org, Rob Herring , linux-mediatek@lists.infradead.org, Matthias Brugger , Dan Williams , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 2/2] dmaengine: mediatek: Add MediaTek Command-Queue DMA controller for MT6765 SoC Message-ID: <20190108165946.GQ13372@vkoul-mobl.Dlink> References: <1545916258-18218-1-git-send-email-shun-chih.yu@mediatek.com> <1545916258-18218-3-git-send-email-shun-chih.yu@mediatek.com> <20190104123836.GB13372@vkoul-mobl.Dlink> <1546949984.25257.96.camel@mtkswgap22> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1546949984.25257.96.camel@mtkswgap22> 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 08-01-19, 20:19, Shun-Chih.Yu wrote: > On Fri, 2019-01-04 at 18:08 +0530, Vinod Koul wrote: > > On 27-12-18, 21:10, shun-chih.yu@mediatek.com wrote: > > > From: Shun-Chih Yu > > Have you tested this with dmatest, if so can you provide results of the > > test as well. > Yes, I tested with dmatest in multi-thread version. > The results shown below, and I would attach them in the next revision if needed. > > dmatest: dma0chan0-copy2: summary 5000 tests, 0 failures 3500 iops 28037 > KB/s (0) > dmatest: dma0chan0-copy4: summary 5000 tests, 0 failures 3494 iops 27612 > KB/s (0) > dmatest: dma0chan0-copy1: summary 5000 tests, 0 failures 3491 iops 27749 > KB/s (0) > dmatest: dma0chan0-copy7: summary 5000 tests, 0 failures 3673 iops 29092 > KB/s (0) > dmatest: dma0chan0-copy6: summary 5000 tests, 0 failures 3763 iops 30237 > KB/s (0) > dmatest: dma0chan0-copy0: summary 5000 tests, 0 failures 3730 iops 30131 > KB/s (0) > dmatest: dma0chan0-copy3: summary 5000 tests, 0 failures 3717 iops 29569 > KB/s (0) > dmatest: dma0chan0-copy5: summary 5000 tests, 0 failures 3699 iops 29302 > KB/s (0) Having them in cover letter helps :) > > > Signed-off-by: Shun-Chih Yu > > > Reviewed-by: Vinod Koul > > > > This is _WRONG_ I have never provided such tag, can you explain why this > > was added without my approval? > So sorry about this, I misunderstood the usage of reviewed-by tag and I > would remove this. Thanks for pointing out this mistake. This tag should be added _only_ when someone replies with Reviewed-by: ..., same goes for Acked-by and Tested-by: ... etc > > > +static void mtk_dma_write(struct mtk_cqdma_pchan *pc, u32 reg, u32 val) > > > +{ > > > + writel_relaxed(val, pc->base + reg); > > > > Why is it relaxed one? > Most of the operations to the CQDMA hardware could be relaxed, and the looks like you missed the rest of sentence > > > +static enum dma_status mtk_cqdma_tx_status(struct dma_chan *c, > > > + dma_cookie_t cookie, > > > + struct dma_tx_state *txstate) > > > +{ > > > + struct mtk_cqdma_vchan *cvc = to_cqdma_vchan(c); > > > + struct mtk_cqdma_vdesc *cvd; > > > + struct virt_dma_desc *vd; > > > + enum dma_status ret; > > > + unsigned long flags; > > > + size_t bytes = 0; > > > + > > > + ret = dma_cookie_status(c, cookie, txstate); > > > + if (ret == DMA_COMPLETE || !txstate) > > > + return ret; > > > + > > > + spin_lock_irqsave(&cvc->vc.lock, flags); > > > + vd = mtk_cqdma_find_active_desc(c, cookie); > > > + spin_unlock_irqrestore(&cvc->vc.lock, flags); > > > + > > > + if (vd) { > > > + cvd = to_cqdma_vdesc(vd); > > > + bytes = cvd->len; > > > + } > > > + > > > + dma_set_residue(txstate, bytes); > > > > Have you tested this and are able to report residue properly? > > > I tested and thought the residue report properly. But after checking the > definition of residue in tx_status again, I found that should be always > return 0 in the driver instead, since there is no state DMA_IN_PROGRESS > or DMA_PAUSED in the driver. I would fix this in the next revision. So memcpy is quite fast :D, that's why. This is more helpful in slave-dma which is relatively slow :) -- ~Vinod