public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Vinod Koul <vkoul@kernel.org>
Cc: Lizhi Hou <lizhi.hou@amd.com>, Brian Xu <brian.xu@amd.com>,
	Raj Kumar Rampelli <raj.kumar.rampelli@amd.com>,
	Michal Simek <michal.simek@amd.com>,
	dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] dmaengine: xilinx: xdma: Support cyclic transfers
Date: Tue, 3 Oct 2023 11:02:56 +0200	[thread overview]
Message-ID: <20231003110256.44286fcd@xps-13> (raw)
In-Reply-To: <ZRVbZwQz13hL2QfY@matsya>

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?

> Otherwise series lgtm, just fix the error reported by test bot

I will.

> 
> > +	if (!desc || !desc->cyclic) {
> > +		spin_unlock_irqrestore(&xdma_chan->vchan.lock, flags);
> > +		return ret;
> > +	}  


Thanks,
Miquèl

  reply	other threads:[~2023-10-03  9:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-22 16:20 [PATCH v2 0/2] dmaengine: xdma: Cyclic transfers support Miquel Raynal
2023-09-22 16:20 ` [PATCH v2 1/2] dmaengine: xilinx: xdma: Prepare the introduction of cyclic transfers Miquel Raynal
2023-09-22 16:20 ` [PATCH v2 2/2] dmaengine: xilinx: xdma: Support " Miquel Raynal
2023-09-22 17:43   ` kernel test robot
2023-09-28 10:54   ` Vinod Koul
2023-10-03  9:02     ` Miquel Raynal [this message]
2023-10-04  7:29       ` Vinod Koul
2023-10-04  7:46         ` Miquel Raynal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231003110256.44286fcd@xps-13 \
    --to=miquel.raynal@bootlin.com \
    --cc=brian.xu@amd.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizhi.hou@amd.com \
    --cc=michal.simek@amd.com \
    --cc=raj.kumar.rampelli@amd.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox