From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/amdgpu: fix MES queue init wptr reset on atomic64 carriers
Date: Thu, 04 Jun 2026 13:17:09 +1000 [thread overview]
Message-ID: <review-overall-20260602050354.2237095-1-runyu.xiao@seu.edu.cn> (raw)
In-Reply-To: <20260602050354.2237095-1-runyu.xiao@seu.edu.cn>
Overall Series Review
Subject: drm/amdgpu: fix MES queue init wptr reset on atomic64 carriers
Author: Runyu Xiao <runyu.xiao@seu.edu.cn>
Patches: 5
Reviewed: 2026-06-04T13:17:09.171124
---
**Series: drm/amdgpu: fix MES queue init wptr reset on atomic64 carriers (2 patches)**
The premise of this series is that `*(ring->wptr_cpu_addr) = 0` only writes 32 bits because `wptr_cpu_addr` is typed as `u32 *`, while the normal read/write paths use `atomic64_set()`/`atomic64_read()` which treat the same memory as a 64-bit value. The claim that the plain store "only clears the low 32 bits" is **correct** — `wptr_cpu_addr` is `u32 *`, so `*wptr_cpu_addr = 0` is a 32-bit store, leaving the upper 32 bits untouched.
However, **the practical severity is questionable**. The write pointer (`ring->wptr`) is a ring buffer offset. On a reset/suspend path, the ring is being cleared entirely (`amdgpu_ring_clear_ring(ring)`), and the wptr value itself is typically well within 32-bit range for normal operation. The upper 32 bits would only be non-zero after the ring has wrapped an extraordinary number of times (past 4G entries). That said, the fix is trivially correct — using the same access width as the normal read/write paths is strictly better and removes a latent inconsistency.
**The `rptr_cpu_addr` reset on the adjacent line has the same pattern** but is not addressed. In `mes_v11_0` and `mes_v12_0`, `rptr_cpu_addr` is read via `*ring->rptr_cpu_addr` (32-bit read in `ring_get_rptr`), so the 32-bit store to rptr is at least consistent with its reader. The wptr case is different because its reader uses `atomic64_read()`. So the wptr fix is correctly scoped.
**Verdict:** The fix is correct and consistent with the existing access pattern. Low practical risk but a real inconsistency. Appropriate for stable backport if accepted.
---
Generated by Claude Code Patch Reviewer
prev parent reply other threads:[~2026-06-04 3:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-02 5:03 [PATCH 0/2] drm/amdgpu: fix MES queue init wptr reset on atomic64 carriers Runyu Xiao
2026-06-02 5:03 ` [PATCH 1/2] drm/amdgpu/mes11: fix queue init wptr reset Runyu Xiao
2026-06-02 9:49 ` Christian König
2026-06-02 10:53 ` 肖润宇
2026-06-02 11:19 ` Christian König
2026-06-02 12:03 ` Runyu Xiao
2026-06-03 9:00 ` Runyu Xiao
2026-06-04 3:17 ` Claude review: " Claude Code Review Bot
2026-06-02 5:03 ` [PATCH 2/2] drm/amdgpu/mes12: " Runyu Xiao
2026-06-04 3:17 ` Claude review: " Claude Code Review Bot
2026-06-04 3:17 ` Claude Code Review Bot [this message]
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-overall-20260602050354.2237095-1-runyu.xiao@seu.edu.cn \
--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