Patchwork dma-mapping: remove a pointless memset in dma_atomic_pool_init

login
register
mail settings
Submitter Christoph Hellwig
Date Dec. 4, 2018, 4:06 p.m.
Message ID <20181204160619.3253-1-hch@lst.de>
Download mbox | patch
Permalink /patch/672147/
State New
Headers show

Comments

Christoph Hellwig - Dec. 4, 2018, 4:06 p.m.
We already zero the memory after allocating it from the pool that
this function fills, and having the memset here in this form means
we can't support CMA highmem allocations.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reported-by: Russell King - ARM Linux <linux@armlinux.org.uk>
---
 kernel/dma/remap.c | 1 -
 1 file changed, 1 deletion(-)
Christoph Hellwig - Dec. 10, 2018, 7:28 p.m.
ping?

On Tue, Dec 04, 2018 at 08:06:19AM -0800, Christoph Hellwig wrote:
> We already zero the memory after allocating it from the pool that
> this function fills, and having the memset here in this form means
> we can't support CMA highmem allocations.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Reported-by: Russell King - ARM Linux <linux@armlinux.org.uk>
> ---
>  kernel/dma/remap.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/kernel/dma/remap.c b/kernel/dma/remap.c
> index 68a64e3ff6a1..6e784824326f 100644
> --- a/kernel/dma/remap.c
> +++ b/kernel/dma/remap.c
> @@ -121,7 +121,6 @@ int __init dma_atomic_pool_init(gfp_t gfp, pgprot_t prot)
>  	if (!page)
>  		goto out;
>  
> -	memset(page_address(page), 0, atomic_pool_size);
>  	arch_dma_prep_coherent(page, atomic_pool_size);
>  
>  	atomic_pool = gen_pool_create(PAGE_SHIFT, -1);
> -- 
> 2.19.1
> 
> _______________________________________________
> iommu mailing list
> iommu@lists.linux-foundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/iommu
---end quoted text---

Patch

diff --git a/kernel/dma/remap.c b/kernel/dma/remap.c
index 68a64e3ff6a1..6e784824326f 100644
--- a/kernel/dma/remap.c
+++ b/kernel/dma/remap.c
@@ -121,7 +121,6 @@  int __init dma_atomic_pool_init(gfp_t gfp, pgprot_t prot)
 	if (!page)
 		goto out;
 
-	memset(page_address(page), 0, atomic_pool_size);
 	arch_dma_prep_coherent(page, atomic_pool_size);
 
 	atomic_pool = gen_pool_create(PAGE_SHIFT, -1);