From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C42C6E8FDD1 for ; Wed, 4 Oct 2023 07:30:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gw+FpOj+HGsVSIUFX1CEVi+qVM65JFP0isxBcd5CPsQ=; b=jZ5xdiYpq5MBF4 cDRYYOwz7e6sxJwyJeFYQTu6T8u0qnDAlpz3etCYdJR8fBUb5JasC2qLX1w0e7t91jbERRYZkqTdB iy8snl7+V7nXTSgVDaXMMFy2IaL96iSeAQjNy7maJe9KyJZVHEBO0bR1ZNqyADHI7jxE8ziFB/a0i /8e6gt1RGRHVV0x6l44vWN9U8Ebekfp7hmQwnjMSgMdSGI6tnktZkfNHLy3qrlHd3WJvwxmRuCmf0 EiaberAp30wyv+UbOdD2/l+YJ6lAqQtt/Wx37aq9fUz2QwXkGe/sUXDPyaydi4qV4Qs3ITUhLODRX vda6789G0vPDLnw/rDGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qnwK6-00GbUG-0I; Wed, 04 Oct 2023 07:29:34 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qnwK3-00GbTN-06 for linux-arm-kernel@lists.infradead.org; Wed, 04 Oct 2023 07:29:32 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id ADC436145E; Wed, 4 Oct 2023 07:29:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D38CBC433C8; Wed, 4 Oct 2023 07:29:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696404569; bh=7gJoTQ9PDdIbeq4D3fsl2MCJhtdJJmthj0WgCiLTxxI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=iZjYsEWmSrA3UbuP+KSwQX5dJHI0sA/Mwrapi8qkC/ZQKmdMzqeNp2+qABGZuaU8u eT4iHn7foTSSHpv3OC6Yl/KrliAffvQPS67W/GW3GJ0c+gER5DccDM5oiyl2UrifjK +lurzy7CYs5FNzVMPNz8MFGnzVlOm015Chawf+2PbJ1qzI+3LplarNg7Fh7+chlz6Q ulA2jK/Sj2z1UJI1lmQUpd/Qkprk+BJlgJP0P1RTvw5uRgEg4YjBJs7eZIB2fATuoX Nv2PH4Yu8nCo/UkO4HvoTuVlN3ApdYTYQeDlKIJtoZYEGiclkfvzGY08zqzIuc2KNz zMWWO1oeo+WsA== Date: Wed, 4 Oct 2023 12:59:25 +0530 From: Vinod Koul To: Miquel Raynal Cc: Lizhi Hou , Brian Xu , Raj Kumar Rampelli , Michal Simek , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Thomas Petazzoni , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] dmaengine: xilinx: xdma: Support cyclic transfers Message-ID: References: <20230922162056.594933-1-miquel.raynal@bootlin.com> <20230922162056.594933-3-miquel.raynal@bootlin.com> <20231003110256.44286fcd@xps-13> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231003110256.44286fcd@xps-13> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231004_002931_109328_1CEE6181 X-CRM114-Status: GOOD ( 20.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 03-10-23, 11:02, Miquel Raynal wrote: > Hi Vinod, > > Thanks for the feedback. > > vkoul@kernel.org wrote on Thu, 28 Sep 2023 16:24:31 +0530: > > > On 22-09-23, 18:20, Miquel Raynal wrote: > > > > > @@ -583,7 +690,36 @@ static int xdma_alloc_chan_resources(struct dma_chan *chan) > > > static enum dma_status xdma_tx_status(struct dma_chan *chan, dma_cookie_t cookie, > > > struct dma_tx_state *state) > > > { > > > - return dma_cookie_status(chan, cookie, state); > > > + struct xdma_chan *xdma_chan = to_xdma_chan(chan); > > > + struct xdma_desc *desc = NULL; > > > + struct virt_dma_desc *vd; > > > + enum dma_status ret; > > > + unsigned long flags; > > > + unsigned int period_idx; > > > + u32 residue = 0; > > > + > > > + ret = dma_cookie_status(chan, cookie, state); > > > + if (ret == DMA_COMPLETE) > > > + return ret; > > > + > > > + spin_lock_irqsave(&xdma_chan->vchan.lock, flags); > > > + > > > + vd = vchan_find_desc(&xdma_chan->vchan, cookie); > > > + if (vd) > > > + desc = to_xdma_desc(vd); > > > > vd is not used in below check, so should be done after below checks, why > > do this for cyclic case? > > I'm not sure I get this comment. vd is my way to get the descriptor, > and I need the descriptor to know whether we are in a cyclic transfer > or not. If the transfer is not cyclic, I just return the value from > dma_cookie_status() like before, otherwise I update the residue based > on the content of desc. > > Maybe I don't understand what you mean, would you mind explaining it > again? Sorry I am not sure what I was thinking, this looks fine, we need the lock to get the desc and use it -- ~Vinod _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel