From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: dma: contiguous: Turn heap registration logic around
Date: Wed, 04 Mar 2026 07:41:35 +1000 [thread overview]
Message-ID: <review-patch1-20260303-dma-buf-heaps-as-modules-v3-1-24344812c707@kernel.org> (raw)
In-Reply-To: <20260303-dma-buf-heaps-as-modules-v3-1-24344812c707@kernel.org>
Patch Review
This patch inverts the CMA heap registration: instead of `rmem_cma_setup()` calling into `cma_heap.c` to register each reserved region, it stores them in `rmem_cma_areas[]` inside `contiguous.c` and provides an iterator `dma_contiguous_get_reserved_region()` for the heap to use.
**Bug (build break):** The patch removes the `dma_heap_cma_register_heap()` function definition from `cma_heap.c`, but fails to remove:
1. The call at `kernel/dma/contiguous.c:276`:
```c
ret = dma_heap_cma_register_heap(dma_contiguous_default_area);
if (ret)
pr_warn("Couldn't register default CMA heap.");
```
2. The header `include/linux/dma-buf/heaps/cma.h` which still declares the function:
```c
#ifdef CONFIG_DMABUF_HEAPS_CMA
int dma_heap_cma_register_heap(struct cma *cma);
#else
static inline int dma_heap_cma_register_heap(struct cma *cma)
{
return 0;
}
#endif
```
3. The `#include <linux/dma-buf/heaps/cma.h>` at `kernel/dma/contiguous.c:45`.
When `CONFIG_DMABUF_HEAPS_CMA=y`, the `#ifdef` in the header selects the non-inline declaration, but there is no corresponding definition in any `.c` file, resulting in a linker error. This call is now functionally redundant anyway, since `add_cma_heaps()` already retrieves the default CMA area via `dev_get_cma_area(NULL)`.
**Fix:** Remove the call at `contiguous.c:276-278`, remove the `include/linux/dma-buf/heaps/cma.h` header entirely (it has no remaining purpose), and remove the `#include` at `contiguous.c:45`.
The series is **not bisectable** at this patch as-is (`CONFIG_DMABUF_HEAPS_CMA=y` breaks from this point onward).
The new `rmem_cma_areas[]` and `dma_contiguous_get_reserved_region()` implementation itself looks correct. The array is correctly not marked `__initdata` since it must persist for the module to query at load time.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-03-03 21:41 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-03 10:13 [PATCH v3 0/8] dma-buf: heaps: Turn heaps into modules Maxime Ripard
2026-03-03 10:13 ` [PATCH v3 1/8] dma: contiguous: Turn heap registration logic around Maxime Ripard
2026-03-03 21:41 ` Claude Code Review Bot [this message]
2026-03-03 10:13 ` [PATCH v3 2/8] dma: contiguous: Make dev_get_cma_area() a proper function Maxime Ripard
2026-03-03 21:41 ` Claude review: " Claude Code Review Bot
2026-03-03 10:13 ` [PATCH v3 3/8] dma: contiguous: Make dma_contiguous_default_area static Maxime Ripard
2026-03-03 21:41 ` Claude review: " Claude Code Review Bot
2026-03-03 10:13 ` [PATCH v3 4/8] dma: contiguous: Export dev_get_cma_area() Maxime Ripard
2026-03-03 21:41 ` Claude review: " Claude Code Review Bot
2026-03-03 10:13 ` [PATCH v3 5/8] mm: cma: Export cma_alloc(), cma_release() and cma_get_name() Maxime Ripard
2026-03-03 21:41 ` Claude review: " Claude Code Review Bot
2026-03-03 10:13 ` [PATCH v3 6/8] dma-buf: heaps: Export mem_accounting parameter Maxime Ripard
2026-03-03 21:41 ` Claude review: " Claude Code Review Bot
2026-03-03 10:13 ` [PATCH v3 7/8] dma-buf: heaps: cma: Turn the heap into a module Maxime Ripard
2026-03-03 21:41 ` Claude review: " Claude Code Review Bot
2026-03-03 10:13 ` [PATCH v3 8/8] dma-buf: heaps: system: " Maxime Ripard
2026-03-03 21:41 ` Claude review: " Claude Code Review Bot
2026-03-03 21:41 ` Claude review: dma-buf: heaps: Turn heaps into modules Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-02-25 16:41 [PATCH 0/7] " Maxime Ripard
2026-02-25 16:41 ` [PATCH 1/7] dma: contiguous: Turn heap registration logic around Maxime Ripard
2026-02-27 3:12 ` Claude review: " Claude Code Review Bot
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=review-patch1-20260303-dma-buf-heaps-as-modules-v3-1-24344812c707@kernel.org \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.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