public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: dma-buf: heaps: coherent: Turn heap into a module
Date: Wed, 04 Mar 2026 07:19:21 +1000	[thread overview]
Message-ID: <review-patch6-20260303-b4-dmabuf-heap-coherent-rmem-v2-6-65a4653b3378@redhat.com> (raw)
In-Reply-To: <20260303-b4-dmabuf-heap-coherent-rmem-v2-6-65a4653b3378@redhat.com>

Patch Review

Changes Kconfig from `bool` to `tristate` and adds `MODULE_LICENSE`/`MODULE_IMPORT_NS`.

**Issues:**

1. **No module unload support.** The commit message says "This heap won't be able to unload" but there is no mechanism to prevent unloading -- no `module_exit` is defined, which means the module simply can't be unloaded (rmmod will fail). This is acceptable but should ideally use a comment or a `[permanent]` module attribute to make the intent explicit.

2. **`MODULE_LICENSE("GPL")` should have been in patch 4** where `module_init()` was first added. The split makes patch 4 not compile as a standalone module (though it's `bool` in that patch).

3. **Overall looks fine** -- the namespace imports are correct.

---

**Summary of key concerns (by severity):**

- **High:** `virt_to_page()` on `dma_alloc_coherent()` memory is not portable (patch 4)
- **High:** Type error in `dma_heap_add()` returning `PTR_ERR()` as a pointer (patch 2, fixed in patch 4 but breaks bisect)
- **Medium:** Potential double-release in `dma_heap_register()` error path with `device_destroy()` + `dma_heap_destroy()` (patch 2)
- **Medium:** `kfree(heap->name)` in `dma_heap_dev_release()` is unsafe for string literal names from existing callers (patch 2)
- **Medium:** Cache aliasing between `vmap(PAGE_KERNEL)` and uncached DMA coherent mapping (patch 4)
- **Medium:** Dead `dma_heap_coherent_register()` declaration with no implementation (patch 4)
- **Low:** Refcount leak from `get_device()` in patch 1 (fixed by patch 2, but breaks bisect)
- **Low:** `dma_map_sgtable` error code discarded (patch 4)
- **Low:** `dma_coerce_mask_and_coherent()` misuse (patch 4)

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-03-03 21:19 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-03 12:33 [PATCH v2 0/6] dma-buf: heaps: add coherent reserved-memory heap Albert Esteve
2026-03-03 12:33 ` [PATCH v2 1/6] dma-buf: dma-heap: Keep track of the heap device struct Albert Esteve
2026-03-03 13:10   ` Maxime Ripard
2026-03-03 21:19   ` Claude review: " Claude Code Review Bot
2026-03-03 12:33 ` [PATCH v2 2/6] dma-buf: dma-heap: split dma_heap_add Albert Esteve
2026-03-03 21:19   ` Claude review: " Claude Code Review Bot
2026-03-03 12:33 ` [PATCH v2 3/6] of_reserved_mem: add a helper for rmem device_init op Albert Esteve
2026-03-03 13:13   ` Maxime Ripard
2026-03-03 21:19   ` Claude review: " Claude Code Review Bot
2026-03-03 12:33 ` [PATCH v2 4/6] dma-buf: heaps: Add Coherent heap to dmabuf heaps Albert Esteve
2026-03-03 13:20   ` Maxime Ripard
2026-03-03 14:47     ` Albert Esteve
2026-03-03 21:19   ` Claude review: " Claude Code Review Bot
2026-03-03 12:33 ` [PATCH v2 5/6] dma: coherent: register to coherent heap Albert Esteve
2026-03-03 21:19   ` Claude review: " Claude Code Review Bot
2026-03-03 12:33 ` [PATCH v2 6/6] dma-buf: heaps: coherent: Turn heap into a module Albert Esteve
2026-03-03 21:19   ` Claude Code Review Bot [this message]
2026-03-03 20:55 ` [PATCH v2 0/6] dma-buf: heaps: add coherent reserved-memory heap John Stultz
2026-03-03 21:19 ` Claude review: " Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-03-06 10:36 [PATCH v3 0/6] " Albert Esteve
2026-03-06 10:36 ` [PATCH v3 6/6] dma-buf: heaps: coherent: Turn heap into a module Albert Esteve
2026-03-08 23:02   ` 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-patch6-20260303-b4-dmabuf-heap-coherent-rmem-v2-6-65a4653b3378@redhat.com \
    --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