From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8380C77B7F for ; Fri, 27 Jun 2025 10:10:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 973586B00C9; Fri, 27 Jun 2025 06:10:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9239A6B00CA; Fri, 27 Jun 2025 06:10:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 812F86B00CB; Fri, 27 Jun 2025 06:10:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 6908A6B00C9 for ; Fri, 27 Jun 2025 06:10:35 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 43BDE104DC6 for ; Fri, 27 Jun 2025 10:10:35 +0000 (UTC) X-FDA: 83600761230.03.B9840F9 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by imf14.hostedemail.com (Postfix) with ESMTP id 462AB10000A for ; Fri, 27 Jun 2025 10:10:33 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=suse.com header.s=google header.b=KHNfJtYk; spf=pass (imf14.hostedemail.com: domain of ptesarik@suse.com designates 209.85.221.50 as permitted sender) smtp.mailfrom=ptesarik@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1751019033; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=vkvls7hwXwv0ykrBS/xxPUz/PpMkCNXsAILifVa3mmw=; b=J/CDROWUjQcyw9HoWbi3r8xgiF80RWHbRBu7UW3cR9zXpcmc9jBe7SXR2ijkCKq5d2w+95 rWO38oVvvzWyV27GYuTVUpomsRMyu5devvCEtCq5sO0PCTxfHzSyBpRSdlJYtZzakxqlr0 dKvW2Xk5TI0BNhJQdDh8CI6oB2BfT6Y= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1751019033; a=rsa-sha256; cv=none; b=bCpzGz3kl0uYoX0g4g+TypS6CTvIO76fMkvoLn6+7qoEgwsl5FVV9Rdj98Zz/A7It0N6Lf zqNo9x+nygV5bZ8nvhYm7RiuaiDcaEhtFKai/Z6Afyv41UHqtdNlpeKsTRAQ7TnSBiThOc GOq6TVE1ReW4O8Kz5aaIMbGJui+dHx0= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=suse.com header.s=google header.b=KHNfJtYk; spf=pass (imf14.hostedemail.com: domain of ptesarik@suse.com designates 209.85.221.50 as permitted sender) smtp.mailfrom=ptesarik@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-3a4eb4dfd8eso282948f8f.2 for ; Fri, 27 Jun 2025 03:10:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1751019032; x=1751623832; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vkvls7hwXwv0ykrBS/xxPUz/PpMkCNXsAILifVa3mmw=; b=KHNfJtYkFMoR/x/rwL6mwADqG8s1I+CctL1mbTOTU9l/ruMwRh0kVCFDORR13iRbHm 9k6v4IWMt4doNhRndIgmID/Kz+XhiT45RadNvnbxq5fYW6lmc7BJP5X9ha3elxlb2RPS DCUg7GJ+liFYtafGHFrOBSv+FD+qb6liVqJ8Ecru9qhqm3yhqYbJyabV7QQkPeLtilDU z5C//5ioPyP/nY3RztIOS791wckx7zZJmsTlBVLP2+ynojctluGSdRz6HYMwuF8eNFap GyH2UjKxPjqEhCR6Dj5kAnRxDpV8gWgOOE7n5nZ7F21hGZ44EX/H+Nvy2misFdct8eUF LaiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751019032; x=1751623832; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vkvls7hwXwv0ykrBS/xxPUz/PpMkCNXsAILifVa3mmw=; b=uV2akGEq+R/pQcdN/X67DONqECVtyW00tKjJooeHpXNojN8tR5JqiHzXVQEKq8IapV rh7hi1xC3UX9jFR4sfU8JxpYMMb4Abdmad6zC5ScdMyW6Fv2div8ZtbkGr7KRoN404pq hZEBaMwpRTIg/QdlMi8jZ1DxgXCSIBC5lKeYqllKii8ZY1vyTsLcvUHGZDyVqJ/USX/E OhzoI3c8qPYV/oV7kEUcFw0c+B1bAiKPRip5u8pExtjLxHhEjDGp+JNcbcSmaqmpjBSn MxbOID3kzZbjekSEs1lBj1081LPO4E5I/yVN8aIpRNi2+90RKyZsTp9yX88RCj/J6/xZ AoEw== X-Forwarded-Encrypted: i=1; AJvYcCVHIRMAX9Ct04a3aDkvw9F5fQNSa1y40dzpCSZ5G08ETERBWffHoESZgaVlawYQhjg+Ir+ns9DRYw==@kvack.org X-Gm-Message-State: AOJu0YwRtYcDhMwUwW8FBO6FcE/CDIvIm/4YRUSmRd8UAKAypzCkp1jb 6/B62A5yPDGatOmcWTLKRfLoZgUZSyt1NG8a9oLKdIpvL3XPz0ljZ+rNt8qORSTaSnU= X-Gm-Gg: ASbGnctILzrv3qhMnckaQjHGX5riJFwyOHrC+OYZ6Bawkx2VtHdDTpYaA7z76db4p+d JKnsKTXFXq+OgTC228j99vp6aOVIxZSPaRr5lui1lw0vxCwRSXbopjAChOM4lgKCGmumxpLC1IH v6sq/L5qLTWaHlcbfS2wHGot/5xRL0lhAGXFLC70vux2JSyTFonUSwIRCeMI4bAiu35duk4dWnh mlnDghPoVpgorN63SIUE1w67m299h7QQ7u9FZFS6+8QMkzKyUgEwkugmchPa4LXDGAVxt07Kqy4 RTt0H2sN4a89nXyGrZOG6F9sdgayD/5H3BOVIE0WcT0iOw82EBiyzvn9oawEa2EhgXcRhcVbhQo 26EMiiSFg4rg7R/Kb+IZe2W16unjH53PDrkzuglrAojYkawERaGGa X-Google-Smtp-Source: AGHT+IFakGUatYasiyktGr52JfBGbmNZ0F1ECxHAdsFEffpOVWE3hvclPTvYOXXiDSO9IxEw8Dy1HA== X-Received: by 2002:a05:6000:23c9:b0:3a4:f912:86af with SMTP id ffacd0b85a97d-3a8fdc1f2b7mr604008f8f.2.1751019031793; Fri, 27 Jun 2025 03:10:31 -0700 (PDT) Received: from localhost (dynamic-2a00-1028-83b8-1e7a-3010-3bd6-8521-caf1.ipv6.o2.cz. [2a00:1028:83b8:1e7a:3010:3bd6:8521:caf1]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-4538a423abbsm46785495e9.39.2025.06.27.03.10.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Jun 2025 03:10:31 -0700 (PDT) From: Petr Tesarik To: Jonathan Corbet , Randy Dunlap , Robin Murphy , Marek Szyprowski Cc: Andrew Morton , Keith Busch , Jens Axboe , Bagas Sanjaya , 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 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 Message-ID: <20250627101015.1600042-6-ptesarik@suse.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250627101015.1600042-1-ptesarik@suse.com> References: <20250627101015.1600042-1-ptesarik@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 462AB10000A X-Stat-Signature: d6iud13fou9553rqjjbcc9ro11ds3b1k X-Rspam-User: X-HE-Tag: 1751019033-962886 X-HE-Meta: U2FsdGVkX196jLwWQcKvGmY4jCPXr4Uq6DW1ZN2VcH7QpXMuqm558P3CqwJgxw984aNbZWrPw02LJbKPVE3JRj2Bni2eNXMWil4ny5aO0DYNOFfL1yhdgmGgeb17WP2utf4WTGrinuB5Ls4szRECZ3SWpCVsqoFaGNba56oi5mFPGAKvGQCBmnKWRBBbmnPO4OFgWmVLaOMl7yoptXO2yasQMGp/TkZwuaSNW80W+OVKMgh2Th3vkIJSv60T9K2lP8igx3MqF84PBN7tgV/7UAwge6RwY0I17etc2dKlYiRuKp/nwpCJ2pveP8YifpApEfbz+x4GxA9dFkgxqqnS7PUSz2OvwWWpw4mGOUIkz9ofi7efxDFsQUrHC1+ySARbrp/zPOAEgj9RdUclBqhOkUaToE1SKrdCBhxooxKXnN2mP6KgECnSh7qyBQy5csN505wvDM30cW4ZZy/xRcaxGJTg18sQHjdwtydtpI2sH/Liv1ZZ+ghKt5SXUTib3e+IIx/XKwQVvrejstpTRSLvC0Hv1dZo92PX5kln5FGhsAeg6C4J7MqeiS2p/efqEm2guw2h+4fctsOYfxkkAl1WUtX3rnRsnqdS8vpzrCtby6mJ0zdX/VbLx7JPHjhO13BeNaE3IF7Zay88xxiXE/s0627GOaituGJuAmSDETL6noz5SoerC3hfMhJ3wx8eFrImdfdMBH3+AOEJ8JIBS2D3fckjLLqEpvkpgC4KHqPYqccQrv2XgLtsmls0LQX5zWLd8S3vqH6VoxSBYKGtUbpr85zKiud5CdcOyLYKETEWRvOD+UvM2fMWL4b1GGNW0Q0U8oirdkkRj+P4RtcZwNrxrnddiDHwdpuLeumEA6H3BMUB79wlnQIT4sPM4TEYse0llMe7fm3K0PsPgscboG/u/C/hMih2riwi3XjnjJ7Xvo+QJL1ncVVmRfdEdhCAsZ3UyjzPEi1LWFhmmIiaqEH PkD5j/0F qM83L580IozF+ZOlcgG8TdBJULUhyC3ugAxdXJLlu93mUCQFqVJ36m71V21TDYSiT/WMeeykU1w7PZhdsRUJwhCpxz+aDBm0VDnNLtoHv9kRvschbaUaj2DjwNIUWXTllMLkI+jKo3AdTALTiy7ZCdUu1MhutXMwO01M/d4SCiBKoU35MImxdXeNYuLPiIvXQFH92Ka4YcM+Tu0QU/eZqAFdqPusUvC7sZhqbBFl4KjpWZxbe/y+EAKPBtw1jVGVIu/j0Bb5fMTVV8napxvzwkS1gRDQZ0oluGRwN4+Y1TMDiM89xiZX3BVd0/BYYBwo3v6hHhRaaS2S+ko7J88Y7EI1Q3w== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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 --- 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