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/ttm/tests: Fix build failure on PREEMPT_RT Date: Fri, 27 Feb 2026 11:52:16 +1000 Message-ID: In-Reply-To: <20260226151228.256003-1-dev@lankhorst.se> References: <20260226151228.256003-1-dev@lankhorst.se> <20260226151228.256003-1-dev@lankhorst.se> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review **Correctness: Good** The old code was reaching into `ww_mutex` internals: ```c mutex_lock(&bo->base.resv->lock.base); ... mutex_unlock(&bo->base.resv->lock.base); ``` This breaks on `PREEMPT_RT` because `ww_mutex.base` becomes an `rt_mutex_ba= se` rather than a `struct mutex`, so `mutex_lock()`/`mutex_unlock()` don't = apply. The fix correctly uses the public ww_mutex API: ```c ww_mutex_lock(&bo->base.resv->lock, NULL); ... ww_mutex_unlock(&bo->base.resv->lock); ``` Passing `NULL` as the acquire context to `ww_mutex_lock()` is valid =E2=80= =94 it means a single lock acquisition without deadlock detection, which ma= tches the original intent of the test (just hold the lock to force the othe= r thread to block). **Semantic correctness: Good** Looking at how `dma_resv` is used elsewhere in `dma-resv.h`, the standard w= rappers like `dma_resv_lock()` and `dma_resv_unlock()` are thin wrappers ar= ound `ww_mutex_lock()`/`ww_mutex_unlock()`. The test intentionally bypasses= the `dma_resv_lock()` wrapper (which would call `dma_resv_reset_max_fences= ()` on unlock) =E2=80=94 this is acceptable for a unit test that just needs= to hold the raw lock. **Minor observation:** Ideally the test could use `dma_resv_lock(bo->base.r= esv, NULL)` and `dma_resv_unlock(bo->base.resv)` instead of going through `= resv->lock` directly, which would be even more future-proof against interna= l struct changes. However, `dma_resv_unlock()` calls `dma_resv_reset_max_fe= nces()` which may have side effects the test doesn't want, so using the `ww= _mutex` API directly is a reasonable choice. **Reviewed-by worthy: Yes.** This is a clean, minimal fix that addresses a = real build failure. --- Generated by Claude Code Patch Reviewer