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-fence: Move signalling tracepoint to before ops detach Date: Tue, 31 Mar 2026 17:14:43 +1000 Message-ID: In-Reply-To: <20260330133623.17704-1-tvrtko.ursulin@igalia.com> References: <20260330133623.17704-1-tvrtko.ursulin@igalia.com> <20260330133623.17704-1-tvrtko.ursulin@igalia.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 **Analysis:** The tracepoint `trace_dma_fence_signaled(fence)` uses the `dm= a_fence` event class which dereferences `fence->ops` to call `get_driver_na= me()` and `get_timeline_name()` (see `include/trace/events/dma_fence.h` lin= es 24-25): ```c __string(driver, fence->ops->get_driver_name(fence)) __string(timeline, fence->ops->get_timeline_name(fence)) ``` The commit being fixed (541c8f2468b9) added logic that sets `fence->ops` to= NULL when the ops has no `release` or `wait` callback: ```c ops =3D rcu_dereference_protected(fence->ops, true); if (!ops->release && !ops->wait) RCU_INIT_POINTER(fence->ops, NULL); ``` With the tracepoint placed *after* this code (as in the current tree at lin= e 380), enabling the tracepoint will cause a NULL dereference for any fence= whose ops lack both `release` and `wait`. Moving the tracepoint before the ops detach logic is the correct fix. The t= racepoint still runs after the `DMA_FENCE_FLAG_SIGNALED_BIT` is set (which = is the logical signal point), so it still accurately records the signal eve= nt. **Minor observation:** The tracepoint is now also emitted before `fence->ti= mestamp` is assigned. This means the tracepoint fires slightly earlier in t= he sequence =E2=80=94 before timestamp assignment and before callbacks run = =E2=80=94 but the tracepoint doesn't record the timestamp so this is not a = functional concern. **Nit on commit message format:** The `Fixes:` tag should conventionally co= me before the `Signed-off-by`. This is a minor style point and not a blocki= ng issue. **Verdict:** Reviewed-by worthy. The fix is minimal, correct, and addresses= a real crash. --- Generated by Claude Code Patch Reviewer