From: Marek Szyprowski <m.szyprowski@samsung.com>
To: "Maxime Ripard" <mripard@kernel.org>,
"Sumit Semwal" <sumit.semwal@linaro.org>,
"Benjamin Gaignard" <benjamin.gaignard@collabora.com>,
"Brian Starkey" <Brian.Starkey@arm.com>,
"John Stultz" <jstultz@google.com>,
"T.J. Mercier" <tjmercier@google.com>,
"Jonathan Corbet" <corbet@lwn.net>,
"Christian König" <christian.koenig@amd.com>,
"Robin Murphy" <robin.murphy@arm.com>
Cc: Andrew Davis <afd@ti.com>, Jared Kangas <jkangas@redhat.com>,
Mattijs Korpershoek <mkorpershoek@kernel.org>,
linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
linaro-mm-sig@lists.linaro.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, iommu@lists.linux.dev
Subject: Re: [PATCH v8 3/5] dma: contiguous: Register reusable CMA regions at boot
Date: Tue, 14 Oct 2025 09:54:38 +0200 [thread overview]
Message-ID: <e549a9a3-6038-4a9a-aa2a-404fa8fad5c9@samsung.com> (raw)
In-Reply-To: <20251013-dma-buf-ecc-heap-v8-3-04ce150ea3d9@kernel.org>
On 13.10.2025 10:35, Maxime Ripard wrote:
> In order to create a CMA dma-buf heap instance for each CMA heap region
> in the system, we need to collect all of them during boot.
>
> They are created from two main sources: the reserved-memory regions in
> the device tree, and the default CMA region created from the
> configuration or command line parameters, if no default region is
> provided in the device tree.
>
> Let's collect all the device-tree defined CMA regions flagged as
> reusable.
>
> Reviewed-by: T.J. Mercier <tjmercier@google.com>
> Signed-off-by: Maxime Ripard <mripard@kernel.org>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
> kernel/dma/contiguous.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/kernel/dma/contiguous.c b/kernel/dma/contiguous.c
> index d9b9dcba6ff7cf5904ac93b72c061fd59072c41b..d67e95094749d45f43c1809c175e491a3f55b2e1 100644
> --- a/kernel/dma/contiguous.c
> +++ b/kernel/dma/contiguous.c
> @@ -40,10 +40,11 @@
> #include <asm/page.h>
>
> #include <linux/memblock.h>
> #include <linux/err.h>
> #include <linux/sizes.h>
> +#include <linux/dma-buf/heaps/cma.h>
> #include <linux/dma-map-ops.h>
> #include <linux/cma.h>
> #include <linux/nospec.h>
>
> #ifdef CONFIG_CMA_SIZE_MBYTES
> @@ -491,9 +492,13 @@ static int __init rmem_cma_setup(struct reserved_mem *rmem)
> rmem->priv = cma;
>
> pr_info("Reserved memory: created CMA memory pool at %pa, size %ld MiB\n",
> &rmem->base, (unsigned long)rmem->size / SZ_1M);
>
> + err = dma_heap_cma_register_heap(cma);
> + if (err)
> + pr_warn("Couldn't register CMA heap.");
> +
> return 0;
> }
> RESERVEDMEM_OF_DECLARE(cma, "shared-dma-pool", rmem_cma_setup);
> #endif
>
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
next prev parent reply other threads:[~2025-10-14 7:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-13 8:35 [PATCH v8 0/5] dma-buf: heaps: Create a CMA heap for each CMA reserved region Maxime Ripard
2025-10-13 8:35 ` [PATCH v8 1/5] doc: dma-buf: List the heaps by name Maxime Ripard
2025-10-13 8:35 ` [PATCH v8 2/5] dma-buf: heaps: cma: Register list of CMA regions at boot Maxime Ripard
2025-10-13 8:35 ` [PATCH v8 3/5] dma: contiguous: Register reusable " Maxime Ripard
2025-10-14 7:54 ` Marek Szyprowski [this message]
2025-10-13 8:35 ` [PATCH v8 4/5] dma: contiguous: Reserve default CMA heap Maxime Ripard
2025-10-14 7:55 ` Marek Szyprowski
2025-10-13 8:35 ` [PATCH v8 5/5] dma-buf: heaps: cma: Create CMA heap for each CMA reserved region Maxime Ripard
2025-10-15 8:23 ` [PATCH v8 0/5] dma-buf: heaps: Create a " Sumit Semwal
2025-10-18 16:03 ` Sumit Semwal
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=e549a9a3-6038-4a9a-aa2a-404fa8fad5c9@samsung.com \
--to=m.szyprowski@samsung.com \
--cc=Brian.Starkey@arm.com \
--cc=afd@ti.com \
--cc=benjamin.gaignard@collabora.com \
--cc=christian.koenig@amd.com \
--cc=corbet@lwn.net \
--cc=dri-devel@lists.freedesktop.org \
--cc=iommu@lists.linux.dev \
--cc=jkangas@redhat.com \
--cc=jstultz@google.com \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mkorpershoek@kernel.org \
--cc=mripard@kernel.org \
--cc=robin.murphy@arm.com \
--cc=sumit.semwal@linaro.org \
--cc=tjmercier@google.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®