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: <20201109095115.GD3171@vkoul-mobl>
Date:   Mon, 9 Nov 2020 15:21:15 +0530
From:   Vinod Koul <vkoul@...nel.org>
To:     Sia Jee Heng <jee.heng.sia@...el.com>
Cc:     Eugeniy.Paltsev@...opsys.com, andriy.shevchenko@...ux.intel.com,
        dmaengine@...r.kernel.org, linux-kernel@...r.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@...ux.intel.com>
> Signed-off-by: Sia Jee Heng <jee.heng.sia@...el.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

-- 
~Vinod

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ