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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BB1FE8FDD9 for ; Wed, 4 Oct 2023 08:08:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241612AbjJDHqY (ORCPT ); Wed, 4 Oct 2023 03:46:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241576AbjJDHqS (ORCPT ); Wed, 4 Oct 2023 03:46:18 -0400 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61582AC; Wed, 4 Oct 2023 00:46:14 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id DBC48C0012; Wed, 4 Oct 2023 07:46:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1696405572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8pVUUQ+7DMEkzQuJdwWGeYNzfoadiG6zJza5DvYnmG8=; b=oiA1C0pBlt+IQPi0goIxyfvjDFJFrr+isK4UXLcwYxtmOqnUTRUml2vjBSct47qwKPEtF7 Jctboom4Bioobo62cvePSiwLycC0dtvKCMv49jA0dG/BBWTUdd7ssDcIPp41jy89ajASOf xeqdfl0UcLVQ1iBco0UmH/8nZ6ffbnlyfP7hFkyBc+hSE7RDWUzr+b4UVtMYRhluvg96wG VEacVQzvYWioBkA6BKbcZm120MoORQEBAY+Y6k48LVpBFSCDZianxlgmDAL0i82SxgOAtT HbEfFQ7TqyFBfeE3sAnKxUGZDqqhA3VvKxpHiPXVSJft1xSlGbB72o2qOUOo6A== Date: Wed, 4 Oct 2023 09:46:09 +0200 From: Miquel Raynal To: Vinod Koul 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: <20231004094609.2b1ea0c5@xps-13> In-Reply-To: References: <20230922162056.594933-1-miquel.raynal@bootlin.com> <20230922162056.594933-3-miquel.raynal@bootlin.com> <20231003110256.44286fcd@xps-13> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Sasl: miquel.raynal@bootlin.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vinod, vkoul@kernel.org wrote on Wed, 4 Oct 2023 12:59:25 +0530: > On 03-10-23, 11:02, Miquel Raynal wrote: > > Hi Vinod, > >=20 > > Thanks for the feedback. > >=20 > > vkoul@kernel.org wrote on Thu, 28 Sep 2023 16:24:31 +0530: > > =20 > > > On 22-09-23, 18:20, Miquel Raynal wrote: > > > =20 > > > > @@ -583,7 +690,36 @@ static int xdma_alloc_chan_resources(struct dm= a_chan *chan) > > > > static enum dma_status xdma_tx_status(struct dma_chan *chan, dma_c= ookie_t cookie, > > > > struct dma_tx_state *state) > > > > { > > > > - return dma_cookie_status(chan, cookie, state); > > > > + struct xdma_chan *xdma_chan =3D to_xdma_chan(chan); > > > > + struct xdma_desc *desc =3D NULL; > > > > + struct virt_dma_desc *vd; > > > > + enum dma_status ret; > > > > + unsigned long flags; > > > > + unsigned int period_idx; > > > > + u32 residue =3D 0; > > > > + > > > > + ret =3D dma_cookie_status(chan, cookie, state); > > > > + if (ret =3D=3D DMA_COMPLETE) > > > > + return ret; > > > > + > > > > + spin_lock_irqsave(&xdma_chan->vchan.lock, flags); > > > > + > > > > + vd =3D vchan_find_desc(&xdma_chan->vchan, cookie); > > > > + if (vd) > > > > + desc =3D to_xdma_desc(vd); =20 > > >=20 > > > vd is not used in below check, so should be done after below checks, = why > > > do this for cyclic case? =20 > >=20 > > 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. > >=20 > > Maybe I don't understand what you mean, would you mind explaining it > > again? =20 >=20 > Sorry I am not sure what I was thinking, this looks fine, we need the > lock to get the desc and use it Ah ok, no problem :) I'll send the v3 with the missing kernel doc line (kernel test robot report). Thanks, Miqu=C3=A8l