From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: drm/panthor: Part ways with drm_gem_shmem_object Date: Tue, 10 Mar 2026 12:15:41 +1000 Message-ID: In-Reply-To: <20260309151119.290217-6-boris.brezillon@collabora.com> References: <20260309151119.290217-1-boris.brezillon@collabora.com> <20260309151119.290217-6-boris.brezillon@collabora.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review This is the largest and most impactful patch. It replaces the `drm_gem_shme= m_object` base with a plain `drm_gem_object` and implements custom page man= agement, vmap, sgt, pin/unpin, and mmap handling. Key observations: 1. **`panthor_gem_backing_pin_locked` / `panthor_gem_backing_unpin_locked`*= *: The pin/unpin pair is clean, with the unpin explicitly leaving pages all= ocated (lazy cleanup). This is appropriate for the upcoming shrinker. 2. **`panthor_gem_vmap_get_locked` error path**: The error path calls `pant= hor_gem_backing_unpin_locked(bo)` which is correct =E2=80=94 it undoes the = pin acquired earlier in the function. 3. **`panthor_gem_free_object`**: For non-imported objects, the cleanup pro= perly takes the resv lock before cleaning up vmap, sgt, and pages. For impo= rted objects, `drm_prime_gem_destroy()` is called. Note that the `MODULE_IM= PORT_NS("DMA_BUF")` addition is needed because `drm_prime_gem_destroy` is i= n that namespace. 4. **Missing `drm_gem_free_mmap_offset`**: The old code called `drm_gem_fre= e_mmap_offset()` but the new code doesn't seem to. However, `drm_gem_object= _release()` should handle this via the VMA offset manager cleanup, so this = should be fine. 5. **`panthor_gem_create` GFP flags**: The comment about MOVABLE zone and C= MA is carried over from shmem. The `GFP_HIGHUSER | __GFP_RETRY_MAYFAIL | __= GFP_NOWARN` mask is appropriate. 6. **`panthor_gem_alloc_object` missing `flags` parameter type**: The funct= ion takes `uint32_t flags` but the kernel convention is `u32`. Minor style = nit. 7. **`to_panthor_bo` change to `container_of_const`**: Good =E2=80=94 this = properly handles const propagation. 8. The `panthor_gem_fault` handler holds `dma_resv_lock()` unconditionally = (non-interruptible) in the fault path. This is a concern =E2=80=94 if the l= ock is contended, userspace can't be interrupted. This is addressed in patc= h 6 (lazy allocation) where it's reworked. No blocking issues. The lack of R-b on this patch is notable given its size. --- Generated by Claude Code Patch Reviewer