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: <20250221074612.dzbyiqet4jyvrdab@thinkpad>
Date: Fri, 21 Feb 2025 13:16:12 +0530
From: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
To: Devendra K Verma <devverma@....com>
Cc: vkoul@...nel.org, dmaengine@...r.kernel.org, michal.simek@....com,
	linux-kernel@...r.kernel.org, Niklas Cassel <cassel@...nel.org>
Subject: Re: [PATCH] dmaengine: dw-edma: Add simple mode support

On Wed, Feb 19, 2025 at 04:38:47PM +0530, Devendra K Verma wrote:

+ Niklas (who also looked into the MEMCPY for eDMA)

> Added the simple or non-linked list DMA mode of transfer.
> 

Patch subject and description are also simple :) You completely forgot to
mention that you are adding the DMA_MEMCPY support to this driver. That too only
for HDMA.

> Signed-off-by: Devendra K Verma <devverma@....com>
> ---
>  drivers/dma/dw-edma/dw-edma-core.c    | 38 +++++++++++++++++
>  drivers/dma/dw-edma/dw-edma-core.h    |  1 +
>  drivers/dma/dw-edma/dw-hdma-v0-core.c | 59 ++++++++++++++++++++++++++-
>  3 files changed, 97 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/dw-edma/dw-edma-core.c b/drivers/dma/dw-edma/dw-edma-core.c
> index 68236247059d..bd975e6d419a 100644
> --- a/drivers/dma/dw-edma/dw-edma-core.c
> +++ b/drivers/dma/dw-edma/dw-edma-core.c
> @@ -595,6 +595,43 @@ dw_edma_device_prep_interleaved_dma(struct dma_chan *dchan,
>  	return dw_edma_device_transfer(&xfer);
>  }
>  
> +static struct dma_async_tx_descriptor *
> +dw_edma_device_prep_dma_memcpy(struct dma_chan *dchan,
> +			       dma_addr_t dst,
> +			       dma_addr_t src, size_t len,
> +			       unsigned long flags)
> +{
> +	struct dw_edma_chan *chan = dchan2dw_edma_chan(dchan);
> +	struct dw_edma_chunk *chunk;
> +	struct dw_edma_burst *burst;
> +	struct dw_edma_desc *desc;
> +
> +	desc = dw_edma_alloc_desc(chan);
> +	if (unlikely(!desc))
> +		return NULL;
> +
> +	chunk = dw_edma_alloc_chunk(desc);
> +	if (unlikely(!chunk))
> +		goto err_alloc;
> +
> +	burst = dw_edma_alloc_burst(chunk);
> +	if (unlikely(!burst))
> +		goto err_alloc;
> +
> +	burst->sar = src;
> +	burst->dar = dst;

Niklas looked into adding MEMCPY support but blocked by the fact that the
device_prep_dma_memcpy() assumes that the direction is always MEM_TO_MEM. But
the eDMA driver (HDMA also?) only support transfers between remote and local
DDR. So only MEM_TO_DEV and DEV_TO_MEM are valid directions (assuming that we
call the remote DDR as DEV).

One can also argue that since both are DDR addresses anyway, we could use the
MEM_TO_MEM direction. But that will not help in identifying the unsupported
local to local and remote to remote transfers.

I haven't referred the HDMA spec yet, but does HDMA support the above case also?

- Mani

-- 
மணிவண்ணன் சதாசிவம்

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ