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: accel/amdxdna: Create shared functions for AIE2 and AIE4
Date: Tue, 31 Mar 2026 17:05:08 +1000	[thread overview]
Message-ID: <review-patch1-20260330163705.3153647-2-lizhi.hou@amd.com> (raw)
In-Reply-To: <20260330163705.3153647-2-lizhi.hou@amd.com>

Patch Review

This is the refactoring foundation. Moves mailbox management channel, protocol checking, and feature mask into a new `struct aie_device` embedded in `amdxdna_dev_hdl`.

**Issue 1 — Status check semantic change:**
```c
// Old (aie2_message.c):
#define DECLARE_AIE2_MSG(name, op) \
    DECLARE_XDNA_MSG_COMMON(name, op, MAX_AIE2_STATUS_CODE)
...
if (!ret && *hdl->status != AIE2_STATUS_SUCCESS) {

// New (aie.h / aie.c):
#define DECLARE_AIE_MSG(name, op) \
    DECLARE_XDNA_MSG_COMMON(name, op, -1)
...
if (!ret && *hdl->status) {
```
The old code checked against `AIE2_STATUS_SUCCESS` (0) explicitly with a `MAX_AIE2_STATUS_CODE` sentinel for the notify callback. The new code uses `-1` as sentinel and checks `*hdl->status` (truthy = nonzero = error). This happens to be functionally equivalent if `AIE2_STATUS_SUCCESS == 0`, but merging the AIE2 path into a generic check that uses `-1` is a subtle behavioral change that should be called out in the commit message.

**Issue 2 — `fw_feature_tbl` moved to `amdxdna_dev_info`:**
Moving `fw_feature_tbl` from `amdxdna_dev_priv` to `amdxdna_dev_info` is a layering change. The code in `aie_check_protocol()` accesses it via `aie->xdna->dev_info->fw_feature_tbl`. This is fine but the commit message doesn't mention this relocation.

**Issue 3 — Extra blank line removal:**
```c
-
  	op = amdxdna_cmd_get_op(cmd_abo);
```
Unrelated whitespace cleanup snuck into this patch (line ~891 area). Should be in a separate patch or at least noted.

**Minor: `drm_WARN_ON` in `aie_destroy_chann`** takes a `**chann` double pointer, which is a reasonable pattern for NULL-out-on-destroy but differs from the original which operated directly on `ndev->mgmt_chann`.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-03-31  7:05 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-30 16:36 [PATCH V1 0/6] accel/amdxdna: Initial support for AIE4 platform Lizhi Hou
2026-03-30 16:37 ` [PATCH V1 1/6] accel/amdxdna: Create shared functions for AIE2 and AIE4 Lizhi Hou
2026-03-31  7:05   ` Claude Code Review Bot [this message]
2026-03-30 16:37 ` [PATCH V1 2/6] accel/amdxdna: Add basic support for AIE4 devices Lizhi Hou
2026-03-31  7:05   ` Claude review: " Claude Code Review Bot
2026-03-30 16:37 ` [PATCH V1 3/6] accel/amdxdna: Create common PSP interfaces for AIE2 and AIE4 Lizhi Hou
2026-03-31  7:05   ` Claude review: " Claude Code Review Bot
2026-03-30 16:37 ` [PATCH V1 4/6] accel/amdxdna: Add AIE4 firmware loading Lizhi Hou
2026-03-30 20:17   ` Mario Limonciello
2026-03-30 20:30     ` yidong Zhang
2026-03-31  2:45   ` Mario Limonciello
2026-03-31  7:05   ` Claude review: " Claude Code Review Bot
2026-03-30 16:37 ` [PATCH V1 5/6] accel/amdxdna: Create common SMU interfaces for AIE2 and AIE4 Lizhi Hou
2026-03-31  7:05   ` Claude review: " Claude Code Review Bot
2026-03-30 16:37 ` [PATCH V1 6/6] accel/amdxdna: Add AIE4 power on and off support Lizhi Hou
2026-03-31  7:05   ` Claude review: " Claude Code Review Bot
2026-03-31  7:05 ` Claude review: accel/amdxdna: Initial support for AIE4 platform 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-patch1-20260330163705.3153647-2-lizhi.hou@amd.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