From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot 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 Message-ID: In-Reply-To: <20260303-b4-dmabuf-heap-coherent-rmem-v2-6-65a4653b3378@redhat.com> References: <20260303-b4-dmabuf-heap-coherent-rmem-v2-0-65a4653b3378@redhat.com> <20260303-b4-dmabuf-heap-coherent-rmem-v2-6-65a4653b3378@redhat.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 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