From: Petr Tesarik <ptesarik@suse.com>
To: Jonathan Corbet <corbet@lwn.net>,
Randy Dunlap <rdunlap@infradead.org>,
Robin Murphy <robin.murphy@arm.com>,
Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>,
Bagas Sanjaya <bagasdotme@gmail.com>,
linux-doc@vger.kernel.org (open list:DOCUMENTATION),
linux-kernel@vger.kernel.org (open list),
linux-mm@kvack.org (open list:MEMORY MANAGEMENT),
Petr Tesarik <ptesarik@suse.com>
Subject: [PATCH v2 5/8] docs: dma-api: remove duplicate description of the DMA pool API
Date: Fri, 27 Jun 2025 12:10:12 +0200 [thread overview]
Message-ID: <20250627101015.1600042-6-ptesarik@suse.com> (raw)
In-Reply-To: <20250627101015.1600042-1-ptesarik@suse.com>
Move the DMA pool API documentation from Memory Management APIs to
dma-api.rst, replacing the outdated duplicate description there.
Signed-off-by: Petr Tesarik <ptesarik@suse.com>
---
Documentation/core-api/dma-api.rst | 62 ++----------------------------
Documentation/core-api/mm-api.rst | 8 ----
2 files changed, 3 insertions(+), 67 deletions(-)
diff --git a/Documentation/core-api/dma-api.rst b/Documentation/core-api/dma-api.rst
index 3e89e3b0ecfd2..bed6e8fdf56e2 100644
--- a/Documentation/core-api/dma-api.rst
+++ b/Documentation/core-api/dma-api.rst
@@ -83,66 +83,10 @@ much like a struct kmem_cache, except that they use the DMA-coherent allocator,
not __get_free_pages(). Also, they understand common hardware constraints
for alignment, like queue heads needing to be aligned on N-byte boundaries.
+.. kernel-doc:: mm/dmapool.c
+ :export:
-::
-
- struct dma_pool *
- dma_pool_create(const char *name, struct device *dev,
- size_t size, size_t align, size_t alloc);
-
-dma_pool_create() initializes a pool of DMA-coherent buffers
-for use with a given device. It must be called in a context which
-can sleep.
-
-The "name" is for diagnostics (like a struct kmem_cache name); dev and size
-are like what you'd pass to dma_alloc_coherent(). The device's hardware
-alignment requirement for this type of data is "align" (which is expressed
-in bytes, and must be a power of two). If your device has no boundary
-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);
-
-This allocates memory from the pool; the returned memory will meet the
-size and alignment requirements specified at creation time. Pass
-GFP_ATOMIC to prevent blocking, or if it's permitted (not
-in_interrupt, not holding SMP locks), pass GFP_KERNEL to allow
-blocking. Like dma_alloc_coherent(), this returns two values: an
-address usable by the CPU, and the DMA address usable by the pool's
-device.
-
-::
-
- void
- dma_pool_free(struct dma_pool *pool, void *vaddr,
- dma_addr_t addr);
-
-This puts memory back into the pool. The pool is what was passed to
-dma_pool_alloc(); the CPU (vaddr) and DMA addresses are what
-were returned when that routine allocated the memory being freed.
-
-::
-
- void
- dma_pool_destroy(struct dma_pool *pool);
-
-dma_pool_destroy() frees the resources of the pool. It must be
-called in a context which can sleep. Make sure you've freed all allocated
-memory back to the pool before you destroy it.
+.. kernel-doc:: include/linux/dmapool.h
Part Ic - DMA addressing limitations
diff --git a/Documentation/core-api/mm-api.rst b/Documentation/core-api/mm-api.rst
index a61766328ac06..50cfc78429304 100644
--- a/Documentation/core-api/mm-api.rst
+++ b/Documentation/core-api/mm-api.rst
@@ -91,14 +91,6 @@ Memory pools
.. kernel-doc:: mm/mempool.c
:export:
-DMA pools
-=========
-
-.. kernel-doc:: mm/dmapool.c
- :export:
-
-.. kernel-doc:: include/linux/dmapool.h
-
More Memory Management Functions
================================
--
2.49.0
next prev parent reply other threads:[~2025-06-27 10:10 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20250627101022eucas1p2f3715c9c9439ca986217e380d4d3e254@eucas1p2.samsung.com>
2025-06-27 10:10 ` [PATCH v2 0/8] update DMA API documentation Petr Tesarik
2025-06-27 10:10 ` [PATCH v2 1/8] docs: dma-api: use "DMA API" consistently throughout the document Petr Tesarik
2025-06-28 18:56 ` Randy Dunlap
2025-06-27 10:10 ` [PATCH v2 2/8] docs: dma-api: replace consistent with coherent Petr Tesarik
2025-06-28 18:57 ` Randy Dunlap
2025-06-27 10:10 ` [PATCH v2 3/8] docs: dma-api: remove remnants of PCI DMA API Petr Tesarik
2025-06-28 18:58 ` Randy Dunlap
2025-06-27 10:10 ` [PATCH v2 4/8] docs: dma-api: add a kernel-doc comment for dma_pool_zalloc() Petr Tesarik
2025-06-28 19:04 ` Randy Dunlap
2025-07-01 11:38 ` Petr Tesarik
2025-07-01 12:54 ` Jonathan Corbet
2025-07-01 15:46 ` Petr Tesarik
2025-06-27 10:10 ` Petr Tesarik [this message]
2025-06-28 19:01 ` [PATCH v2 5/8] docs: dma-api: remove duplicate description of the DMA pool API Randy Dunlap
2025-06-27 10:10 ` [PATCH v2 6/8] docs: dma-api: clarify DMA addressing limitations Petr Tesarik
2025-06-28 18:58 ` Randy Dunlap
2025-06-27 10:10 ` [PATCH v2 7/8] docs: dma-api: update streaming DMA physical address constraints Petr Tesarik
2025-06-28 18:59 ` Randy Dunlap
2025-06-30 1:32 ` Bagas Sanjaya
2025-06-27 10:10 ` [PATCH v2 8/8] docs: dma-api: clean up documentation of dma_map_sg() Petr Tesarik
2025-06-28 19:00 ` Randy Dunlap
2025-06-27 17:03 ` [PATCH v2 0/8] update DMA API documentation Marek Szyprowski
2025-07-01 19:53 ` Jonathan Corbet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250627101015.1600042-6-ptesarik@suse.com \
--to=ptesarik@suse.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=bagasdotme@gmail.com \
--cc=corbet@lwn.net \
--cc=kbusch@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=m.szyprowski@samsung.com \
--cc=rdunlap@infradead.org \
--cc=robin.murphy@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®