]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Mar 2015 15:25:10 +0000 (16:25 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Mar 2015 15:25:10 +0000 (16:25 +0100)
added patches:
arm64-honor-__gfp_zero-in-dma-allocations.patch

queue-3.14/arm64-honor-__gfp_zero-in-dma-allocations.patch [new file with mode: 0644]
queue-3.14/series

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 (file)
index 0000000..8c450fd
--- /dev/null
@@ -0,0 +1,44 @@
+From 7132813c384515c9dede1ae20e56f3895feb7f1e Mon Sep 17 00:00:00 2001
+From: "Suzuki K. Poulose" <suzuki.poulose@arm.com>
+Date: Thu, 19 Mar 2015 18:17:09 +0000
+Subject: arm64: Honor __GFP_ZERO in dma allocations
+
+From: "Suzuki K. Poulose" <suzuki.poulose@arm.com>
+
+commit 7132813c384515c9dede1ae20e56f3895feb7f1e upstream.
+
+Current implementation doesn't zero out the pages allocated.
+Honor the __GFP_ZERO flag and zero out if set.
+
+Cc: <stable@vger.kernel.org> # v3.14+
+Acked-by: Will Deacon <will.deacon@arm.com>
+Signed-off-by: Suzuki K. Poulose <suzuki.poulose@arm.com>
+Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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);
+       }
index 68df65f321906b05496f84fe4a1c50a1cd81fd01..f3c2be1ab4e4f4f75c67524b700de72604d754fd 100644 (file)
@@ -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