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/exec, drm/xe: Avoid abusing the drm_exec retry pointer Date: Mon, 25 May 2026 21:59:35 +1000 Message-ID: In-Reply-To: <20260520101616.41284-4-thomas.hellstrom@linux.intel.com> References: <20260520101616.41284-1-thomas.hellstrom@linux.intel.com> <20260520101616.41284-4-thomas.hellstrom@linux.intel.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review **Assessment: Good, one minor concern.** This formalizes the xe driver's pattern of directly using `goto *__drm_exec_retry_ptr` for OOM retry by introducing `drm_exec_retry()`: ```c #define drm_exec_retry(_exec) \ do { \ WARN_ON((_exec)->contended != DRM_EXEC_DUMMY); \ goto *__drm_exec_retry_ptr; \ } while (0) ``` The `WARN_ON` check is correct: `xe_validation_should_retry()` calls `drm_exec_fini()` + `drm_exec_init()` before returning true, so `contended == DRM_EXEC_DUMMY` at that point. Then the `goto` jumps back to the `drm_exec_until_all_locked` label, which calls `drm_exec_cleanup()`, which sees `DRM_EXEC_DUMMY` and calls `ww_acquire_init()` to properly initialize the ticket. The flow is safe. **Minor concern:** `DRM_EXEC_DUMMY` is moved from `drm_exec.c` to `drm_exec.h`, exposing an implementation detail in the public header. The "internal use only" comment mitigates this, but drivers could start relying on it. An alternative would be to add a `drm_exec_is_newly_initialized()` inline helper that hides the constant, but since the `goto` must remain in a macro anyway, this is acceptable as-is. Worth mentioning explicitly in the commit message that this is an intentional trade-off. The xe_validation.h change is clean: ```c - goto *__drm_exec_retry_ptr; + drm_exec_retry((_ctx)->exec); ``` And the comment update in xe_validation.c correctly narrows the scope of the "abuses" comment: ```c - * This abuses both drm_exec and ww_mutex internals and should be + * This abuses ww_mutex internals and should be ``` --- Generated by Claude Code Patch Reviewer