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: <12082d54-6014-4a63-8c51-8353f9dd6613@arm.com>
Date: Fri, 29 Aug 2025 21:37:56 +0100
From: Robin Murphy <robin.murphy@....com>
To: Jisheng Zhang <jszhang@...nel.org>, Vinod Koul <vkoul@...nel.org>,
 Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
 Conor Dooley <conor+dt@...nel.org>
Cc: dmaengine@...r.kernel.org, devicetree@...r.kernel.org,
 linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 05/14] dmaengine: dma350: Register the DMA controller to
 DT DMA helpers

On 2025-08-23 4:40 pm, Jisheng Zhang wrote:
> Register the DMA controller to DT DMA helpers so that we convert a DT
> phandle to a dma_chan structure.
> 
> Signed-off-by: Jisheng Zhang <jszhang@...nel.org>
> ---
>   drivers/dma/arm-dma350.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/arm-dma350.c b/drivers/dma/arm-dma350.c
> index 17af9bb2a18f..6a9f81f941b0 100644
> --- a/drivers/dma/arm-dma350.c
> +++ b/drivers/dma/arm-dma350.c
> @@ -7,6 +7,7 @@
>   #include <linux/dma-mapping.h>
>   #include <linux/io.h>
>   #include <linux/of.h>
> +#include <linux/of_dma.h>
>   #include <linux/module.h>
>   #include <linux/platform_device.h>
>   
> @@ -635,7 +636,7 @@ static int d350_probe(struct platform_device *pdev)
>   	if (ret)
>   		return dev_err_probe(dev, ret, "Failed to register DMA device\n");
>   
> -	return 0;
> +	return of_dma_controller_register(dev->of_node, of_dma_xlate_by_chan_id, &dmac->dma);

This only works for channels with HAS_TRIGSEL=0 (where I guess HAS_TRIG 
can be assumed from DT describing one) - with selectable triggers the 
trigger number (which the dma-cell specifier actually is) doesn't bear 
any relation to the channel number, so channel selection is both simpler 
and more complicated at the same time, since we could pick any free 
channel with HAS_TRIGSEL, but that's not necessarily just *any* free 
channel...

Given that at this point the driver only considers nominal trigger 
capability for channels with HAS_TRIGSEL=1, this patch seems effectively 
broken.

Thanks,
Robin.

>   }
>   
>   static void d350_remove(struct platform_device *pdev)
> @@ -643,6 +644,7 @@ static void d350_remove(struct platform_device *pdev)
>   	struct d350 *dmac = platform_get_drvdata(pdev);
>   
>   	dma_async_device_unregister(&dmac->dma);
> +	of_dma_controller_free(pdev->dev.of_node);
>   }
>   
>   static const struct of_device_id d350_of_match[] __maybe_unused = {

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ