public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/exec, drm/xe: Avoid abusing the drm_exec retry pointer
Date: Wed, 01 Apr 2026 07:52:57 +1000	[thread overview]
Message-ID: <review-patch4-20260331092023.81616-5-thomas.hellstrom@linux.intel.com> (raw)
In-Reply-To: <20260331092023.81616-5-thomas.hellstrom@linux.intel.com>

Patch Review

**Functionally correct but the WARN_ON condition may be wrong for the "newly initialized" case described in the doc comment.**

The new `drm_exec_retry()` macro:
```c
#define drm_exec_retry(_exec)
	do {
		WARN_ON(!drm_exec_is_contended(_exec));
		goto *__drm_exec_retry_ptr;
	} while (0)
```

The doc comment says:
> Unconditionally retry the loop to lock all objects. For consistency,
> the exec object needs to be **newly initialized or contended**.

But `WARN_ON(!drm_exec_is_contended(_exec))` will fire when the exec is newly initialized (since `contended` will be NULL after init). The WARN_ON only checks for the contended case, not the "newly initialized" case. Either the comment or the assertion needs updating. If the intent is that only the contended case is valid, the comment should be fixed. If newly-initialized is also valid (as needed for the OOM retry path in xe), then the assertion is too strict.

Looking at the xe usage: `xe_validation_should_retry()` is called on `-ENOMEM`, which could happen before any contention. If `exec->contended` is NULL at that point, this will produce a spurious WARN.

The commit message also says "This is relying on documented behaviour" — perhaps this should say "undocumented" given the context of the series (cleaning up abuses)?

---

---
Generated by Claude Code Patch Reviewer

  parent reply	other threads:[~2026-03-31 21:52 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-31  9:20 [PATCH 0/5] drm/exec: drm_exec polishing Thomas Hellström
2026-03-31  9:20 ` [PATCH 1/5] drm/exec: Remove the index parameter from drm_exec_for_each_locked_obj[_reverse] Thomas Hellström
2026-03-31  9:29   ` Christian König
2026-03-31 21:52   ` Claude review: " Claude Code Review Bot
2026-03-31  9:20 ` [PATCH 2/5] drm/msm: Remove abuse of drm_exec internals Thomas Hellström
2026-03-31  9:30   ` Christian König
2026-03-31  9:36   ` Christian König
2026-03-31 19:08   ` Rob Clark
2026-03-31 19:52     ` Thomas Hellström
2026-03-31 20:39       ` Rob Clark
2026-03-31 21:52   ` Claude review: " Claude Code Review Bot
2026-03-31  9:20 ` [PATCH 3/5] drm/exec: Make the drm_exec_until_all_locked() macro more readable Thomas Hellström
2026-03-31  9:39   ` Christian König
2026-03-31 11:03     ` Thomas Hellström
2026-03-31 21:52   ` Claude review: " Claude Code Review Bot
2026-03-31  9:20 ` [PATCH 4/5] drm/exec, drm/xe: Avoid abusing the drm_exec retry pointer Thomas Hellström
2026-03-31  9:44   ` Christian König
2026-03-31 10:13     ` Thomas Hellström
2026-03-31 11:09       ` Thomas Hellström
2026-03-31 11:59       ` Christian König
2026-03-31 21:52   ` Claude Code Review Bot [this message]
2026-03-31  9:20 ` [PATCH 5/5] drm/exec, drm/xe, drm/amdgpu: Add an accessor for struct drm_exec::ticket Thomas Hellström
2026-03-31  9:46   ` Christian König
2026-03-31 10:18     ` Thomas Hellström
2026-03-31 21:46   ` kernel test robot
2026-03-31 21:52   ` Claude review: " Claude Code Review Bot
2026-03-31 21:52 ` Claude review: drm/exec: drm_exec polishing Claude Code Review Bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=review-patch4-20260331092023.81616-5-thomas.hellstrom@linux.intel.com \
    --to=claude-review@example.com \
    --cc=dri-devel-reviews@example.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox