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/buddy: Integrate lockdep annotations for gpu buddy manager Date: Tue, 05 May 2026 11:39:29 +1000 Message-ID: In-Reply-To: <20260429123714.3913374-2-tejas.upadhyay@intel.com> References: <20260429123714.3913374-2-tejas.upadhyay@intel.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Overall Series Review Subject: drm/buddy: Integrate lockdep annotations for gpu buddy manager Author: Tejas Upadhyay Patches: 4 Reviewed: 2026-05-05T11:39:29.714051 --- This is a single patch adding lockdep annotations to the `gpu_buddy` alloca= tor, closely modeled after the existing `drm_gpusvm_driver_set_lock()` / `d= rm_gpusvm_driver_lock_held()` pattern. The approach is sound: store a point= er to the driver's `lockdep_map`, then assert it's held on entry to exporte= d APIs. The implementation is mostly correct, but has several gaps and issu= es: 1. **Incomplete driver coverage**: Only xe is wired up, but amdgpu, i915, a= nd the ttm test mock manager also call gpu_buddy APIs and need `gpu_buddy_d= river_set_lock()` calls. Without those, the annotation is inert for 3 of 4 = consumers. 2. **Incomplete API coverage**: Two exported functions (`gpu_buddy_fini` an= d `gpu_buddy_block_print`) plus one drm-layer export (`drm_buddy_block_prin= t`) are missing annotations. 3. **Minor style inconsistency**: The `#else` stubs for the no-LOCKDEP case= differ between the macro (uses `do { (void)(mm); (void)(lock); } while (0)= `) and the original pattern (uses `do {} while (0)`). Not a bug, but incons= istent with the `drm_gpusvm` template this was copied from. 4. **The macro lacks the local-variable guard present in the drm_gpusvm tem= plate**: The `drm_gpusvm_driver_set_lock` macro accesses `(gpusvm)` directl= y, but the gpu_buddy version uses a local `__mm`. This is actually an *impr= ovement* over the gpusvm original =E2=80=94 good. Overall this is a reasonable v1 that needs a respin to cover the remaining = callers and APIs. --- Generated by Claude Code Patch Reviewer