From f98e3f1ab53f64bbcc8a31a599397d41b67a7f6d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 24 Mar 2015 16:25:10 +0100 Subject: [PATCH] 3.14-stable patches added patches: arm64-honor-__gfp_zero-in-dma-allocations.patch --- ...-honor-__gfp_zero-in-dma-allocations.patch | 44 +++++++++++++++++++ queue-3.14/series | 1 + 2 files changed, 45 insertions(+) create mode 100644 queue-3.14/arm64-honor-__gfp_zero-in-dma-allocations.patch diff --git a/queue-3.14/arm64-honor-__gfp_zero-in-dma-allocations.patch b/queue-3.14/arm64-honor-__gfp_zero-in-dma-allocations.patch new file mode 100644 index 00000000000..8c450fd89c6 --- /dev/null +++ b/queue-3.14/arm64-honor-__gfp_zero-in-dma-allocations.patch @@ -0,0 +1,44 @@ +From 7132813c384515c9dede1ae20e56f3895feb7f1e Mon Sep 17 00:00:00 2001 +From: "Suzuki K. Poulose" +Date: Thu, 19 Mar 2015 18:17:09 +0000 +Subject: arm64: Honor __GFP_ZERO in dma allocations + +From: "Suzuki K. Poulose" + +commit 7132813c384515c9dede1ae20e56f3895feb7f1e upstream. + +Current implementation doesn't zero out the pages allocated. +Honor the __GFP_ZERO flag and zero out if set. + +Cc: # v3.14+ +Acked-by: Will Deacon +Signed-off-by: Suzuki K. Poulose +Signed-off-by: Catalin Marinas +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm64/mm/dma-mapping.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/arch/arm64/mm/dma-mapping.c ++++ b/arch/arm64/mm/dma-mapping.c +@@ -44,6 +44,7 @@ static void *arm64_swiotlb_alloc_coheren + flags |= GFP_DMA32; + if (IS_ENABLED(CONFIG_DMA_CMA)) { + struct page *page; ++ void *addr; + + size = PAGE_ALIGN(size); + page = dma_alloc_from_contiguous(dev, size >> PAGE_SHIFT, +@@ -52,7 +53,10 @@ static void *arm64_swiotlb_alloc_coheren + return NULL; + + *dma_handle = phys_to_dma(dev, page_to_phys(page)); +- return page_address(page); ++ addr = page_address(page); ++ if (flags & __GFP_ZERO) ++ memset(addr, 0, size); ++ return addr; + } else { + return swiotlb_alloc_coherent(dev, size, dma_handle, flags); + } diff --git a/queue-3.14/series b/queue-3.14/series index 68df65f3219..f3c2be1ab4e 100644 --- a/queue-3.14/series +++ b/queue-3.14/series @@ -65,3 +65,4 @@ ipvs-rerouting-to-local-clients-is-not-needed-anymore.patch netfilter-nft_compat-fix-module-refcount-underflow.patch netfilter-xt_socket-fix-a-stack-corruption-bug.patch arm-imx6sl-evk-set-swbst_reg-as-vbus-s-parent-reg.patch +arm64-honor-__gfp_zero-in-dma-allocations.patch -- 2.47.3