lkml.org 
[lkml]   [2020]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v2 09/15] dmaengine: dw-axi-dmac: Support burst residue granularity
Date


> -----Original Message-----
> From: Vinod Koul <vkoul@kernel.org>
> Sent: 09 November 2020 5:51 PM
> To: Sia, Jee Heng <jee.heng.sia@intel.com>
> Cc: Eugeniy.Paltsev@synopsys.com; andriy.shevchenko@linux.intel.com;
> dmaengine@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH v2 09/15] dmaengine: dw-axi-dmac: Support burst residue
> granularity
>
> On 27-10-20, 14:38, Sia Jee Heng wrote:
> > Add support for DMA_RESIDUE_GRANULARITY_BURST so that AxiDMA can
> > report DMA residue.
> >
> > Existing AxiDMA driver only support data transfer between memory to
> > memory operation, therefore reporting DMA residue to the DMA clients
> > is not supported.
> >
> > Reporting DMA residue to the DMA clients is important as DMA clients
> > shall invoke dmaengine_tx_status() to understand the number of bytes
> > been transferred so that the buffer pointer can be updated accordingly.
> >
> > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Signed-off-by: Sia Jee Heng <jee.heng.sia@intel.com>
> > ---
> > .../dma/dw-axi-dmac/dw-axi-dmac-platform.c | 44 ++++++++++++++++---
> > drivers/dma/dw-axi-dmac/dw-axi-dmac.h | 2 +
> > 2 files changed, 39 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> > b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> > index 011cf7134f25..cd99557a716c 100644
> > --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> > +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> > @@ -265,14 +265,36 @@ dma_chan_tx_status(struct dma_chan *dchan,
> dma_cookie_t cookie,
> > struct dma_tx_state *txstate)
> > {
> > struct axi_dma_chan *chan = dchan_to_axi_dma_chan(dchan);
> > - enum dma_status ret;
> > + struct virt_dma_desc *vdesc;
> > + enum dma_status status;
> > + u32 completed_length;
> > + unsigned long flags;
> > + u32 completed_blocks;
> > + size_t bytes = 0;
> > + u32 length;
> > + u32 len;
> >
> > - ret = dma_cookie_status(dchan, cookie, txstate);
> > + status = dma_cookie_status(dchan, cookie, txstate);
>
> txstate can be null, so please check that as well in the below condition and
> return if that is the case
[>>] noted. Will factor in the null condition check in v3
>
> --
> ~Vinod

\
 
 \ /
  Last update: 2020-11-11 02:44    [W:0.050 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site