[4.2.y stable] Patch "mm: add dma_pool_zalloc() call to DMA API" has been added to the 4.2.y tree
Kamal Mostafa
kamal at canonical.com
Thu Feb 4 17:54:56 UTC 2016
This is a note to let you know that I have just added a patch titled
mm: add dma_pool_zalloc() call to DMA API
to the linux-4.2.y-queue branch of the 4.2.y extended stable tree
which can be found at:
http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-4.2.y-queue
This patch is scheduled to be released in version 4.2.8-ckt4.
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 4.2.y tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Kamal
---8<------------------------------------------------------------
>From cb1692f01564e456d95ce75c635dafb005a67353 Mon Sep 17 00:00:00 2001
From: "Sean O. Stalley" <sean.stalley at intel.com>
Date: Tue, 8 Sep 2015 15:02:27 -0700
Subject: mm: add dma_pool_zalloc() call to DMA API
commit ad82362b2defd4adad87d8538617b2f51a4bf9c3 upstream.
Add a wrapper function for dma_pool_alloc() to get zeroed memory.
Signed-off-by: Sean O. Stalley <sean.stalley at intel.com>
Cc: Vinod Koul <vinod.koul at intel.com>
Cc: Bjorn Helgaas <bhelgaas at google.com>
Cc: Gilles Muller <Gilles.Muller at lip6.fr>
Cc: Nicolas Palix <nicolas.palix at imag.fr>
Cc: Michal Marek <mmarek at suse.cz>
Cc: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
Cc: Jonathan Corbet <corbet at lwn.net>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
[ kamal: 4.2-stable prereq for
27bc944 dmaengine: bcm2835-dma: Convert to use DMA pool ]
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
Documentation/DMA-API.txt | 7 +++++++
include/linux/dmapool.h | 6 ++++++
2 files changed, 13 insertions(+)
diff --git a/Documentation/DMA-API.txt b/Documentation/DMA-API.txt
index 7eba542..edccacd 100644
--- a/Documentation/DMA-API.txt
+++ b/Documentation/DMA-API.txt
@@ -104,6 +104,13 @@ crossing restrictions, pass 0 for alloc; passing 4096 says memory allocated
from this pool must not cross 4KByte boundaries.
+ void *dma_pool_zalloc(struct dma_pool *pool, gfp_t mem_flags,
+ dma_addr_t *handle)
+
+Wraps dma_pool_alloc() and also zeroes the returned memory if the
+allocation attempt succeeded.
+
+
void *dma_pool_alloc(struct dma_pool *pool, gfp_t gfp_flags,
dma_addr_t *dma_handle);
diff --git a/include/linux/dmapool.h b/include/linux/dmapool.h
index e1043f7..53ba737 100644
--- a/include/linux/dmapool.h
+++ b/include/linux/dmapool.h
@@ -24,6 +24,12 @@ void dma_pool_destroy(struct dma_pool *pool);
void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags,
dma_addr_t *handle);
+static inline void *dma_pool_zalloc(struct dma_pool *pool, gfp_t mem_flags,
+ dma_addr_t *handle)
+{
+ return dma_pool_alloc(pool, mem_flags | __GFP_ZERO, handle);
+}
+
void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t addr);
/*
--
1.9.1
More information about the kernel-team
mailing list