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: <c47c117b-dfc7-12e7-7769-15dcf6716d32@ti.com>
Date:   Fri, 3 Aug 2018 10:50:13 +0300
From:   Peter Ujfalusi <peter.ujfalusi@...com>
To:     Huang Shijie <sjhuang@...vatar.ai>, <vkoul@...nel.org>
CC:     <dmaengine@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <dave.jiang@...el.com>, <radhey.shyam.pandey@...inx.com>,
        <appana.durga.rao@...inx.com>, <jmkrzyszt@...il.com>,
        <gomonovych@...il.com>, <keescook@...omium.org>,
        <horms+renesas@...ge.net.au>, <geert+renesas@...der.be>,
        <shawnguo@...nel.org>, <baoyou.xie@...aro.org>,
        <michal.simek@...inx.com>, <baohua@...nel.org>,
        <ludovic.desroches@...rochip.com>, <linus.walleij@...aro.org>,
        <david.brown@...aro.org>
Subject: Re: [PATCH 08/46] dmaengine: edma: use
 dmaenginem_async_device_register to simplify the code



On 2018-08-03 10:19, Huang Shijie wrote:
> Use dmaenginem_async_device_register to simplify the code:
>    remove dma_async_device_unregister
> 
> Signed-off-by: Huang Shijie <sjhuang@...vatar.ai>
> ---
>  drivers/dma/ti/edma.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c
> index ceabdea40ae0..28ba1e722c47 100644
> --- a/drivers/dma/ti/edma.c
> +++ b/drivers/dma/ti/edma.c
> @@ -2388,18 +2388,17 @@ static int edma_probe(struct platform_device *pdev)
>  	ecc->dma_slave.filter.mapcnt = info->slavecnt;
>  	ecc->dma_slave.filter.fn = edma_filter_fn;
>  
> -	ret = dma_async_device_register(&ecc->dma_slave);
> +	ret = dmaenginem_async_device_register(&ecc->dma_slave);
>  	if (ret) {
>  		dev_err(dev, "slave ddev registration failed (%d)\n", ret);
>  		goto err_reg1;
>  	}
>  
>  	if (ecc->dma_memcpy) {
> -		ret = dma_async_device_register(ecc->dma_memcpy);
> +		ret = dmaenginem_async_device_register(ecc->dma_memcpy);
>  		if (ret) {
>  			dev_err(dev, "memcpy ddev registration failed (%d)\n",
>  				ret);
> -			dma_async_device_unregister(&ecc->dma_slave);
>  			goto err_reg1;
>  		}
>  	}
> @@ -2439,9 +2438,6 @@ static int edma_remove(struct platform_device *pdev)
>  
>  	if (dev->of_node)
>  		of_dma_controller_free(dev->of_node);
> -	dma_async_device_unregister(&ecc->dma_slave);
> -	if (ecc->dma_memcpy)
> -		dma_async_device_unregister(ecc->dma_memcpy);

I'm afraid this is not safe either, we need to free the dummy_slot
_after_ the dma device is unregistered.

>  	edma_free_slot(ecc, ecc->dummy_slot);
>  
>  	return 0;
> 

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ