lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZR0UVYAKgix2nRrb@matsya>
Date:   Wed, 4 Oct 2023 12:59:25 +0530
From:   Vinod Koul <vkoul@...nel.org>
To:     Miquel Raynal <miquel.raynal@...tlin.com>
Cc:     Lizhi Hou <lizhi.hou@....com>, Brian Xu <brian.xu@....com>,
        Raj Kumar Rampelli <raj.kumar.rampelli@....com>,
        Michal Simek <michal.simek@....com>, dmaengine@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org,
        Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/2] dmaengine: xilinx: xdma: Support cyclic transfers

On 03-10-23, 11:02, Miquel Raynal wrote:
> Hi Vinod,
> 
> Thanks for the feedback.
> 
> vkoul@...nel.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ