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/xe/xe_ras: Add support for error counter
Date: Fri, 05 Jun 2026 06:10:07 +1000	[thread overview]
Message-ID: <review-patch2-20260604184849.1011985-3-raag.jadav@intel.com> (raw)
In-Reply-To: <20260604184849.1011985-3-raag.jadav@intel.com>

Patch Review

Marked "Do not review, CI only" — I'll note substantive issues only.

**Issues:**

1. **`get_counter` doesn't check `response.status`**: In `get_counter()`:
```c
	common = &response.counter.common;
	*value = response.value;
```
It reads the response value without checking any status field. Compare with `xe_ras_clear_counter()` which does:
```c
	ret = ras_status_to_errno(response.status);
	if (ret) { ... }
```
The `xe_ras_get_counter_response` struct does have a `threshold` field but no explicit `status` field, while `xe_ras_clear_counter_response` has a `status` field. If the firmware can report errors in the get-counter response, this is a bug. If the protocol doesn't include status in get-counter responses, then the structures are correct but the asymmetry should be documented.

2. **Probe order change**: The patch moves `xe_soc_remapper_init()` and `xe_sysctrl_init()` earlier in `xe_device_probe()`, before display and GT initialization. The commit message doesn't explain why this reordering is needed. Moving init earlier could introduce regressions if the remapper/sysctrl depends on state set up between the old and new positions.

3. **Mixed initialization style**: Uses `= {0}` throughout:
```c
	struct xe_ras_get_counter_response response = {0};
```
While patch 3 uses `= {}`. Should be consistent; `= {}` is the preferred kernel style.

4. **`xe_ras_get_counter` parameter name mismatch**: The function signature uses `component` as the third parameter, but the caller (`query_error_counter` in `xe_drm_ras.c`) passes `error_id`:
```c
return xe_ras_get_counter(xe, severity, error_id, val);
```
This works because the DRM RAS error_id IS the component enum value, but the naming conflation is confusing. The `query_error_counter` callback receives `error_id` (which ranges over the counter range, which is set to `DRM_XE_RAS_ERR_COMP_CORE_COMPUTE..DRM_XE_RAS_ERR_COMP_MAX-1`), and `xe_ras_get_counter` calls it `component`. Naming it consistently would help.

5. **Large reserved array in `xe_ras_get_counter_response`**:
```c
	u32 reserved[57];
```
That's 228 bytes of reserved space. This is a protocol struct for a mailbox command — presumably the firmware defines this layout. If so, fine, but it's unusual to see such large reserved fields and it suggests the struct mirrors a fixed-size mailbox buffer rather than the actual response payload.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-06-04 20:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-04 18:46 [PATCH v3 0/4] Introduce error threshold to drm_ras Raag Jadav
2026-06-04 18:46 ` [PATCH v3 1/4] drm/ras: Introduce error threshold Raag Jadav
2026-06-04 20:10   ` Claude review: " Claude Code Review Bot
2026-06-04 18:46 ` [PATCH v3 2/4] drm/xe/xe_ras: Add support for error counter Raag Jadav
2026-06-04 20:10   ` Claude Code Review Bot [this message]
2026-06-04 18:46 ` [PATCH v3 3/4] drm/xe/ras: Add support for error threshold Raag Jadav
2026-06-04 20:10   ` Claude review: " Claude Code Review Bot
2026-06-04 18:46 ` [PATCH v3 4/4] drm/xe/drm_ras: Wire up error threshold callbacks Raag Jadav
2026-06-04 20:10   ` Claude review: " Claude Code Review Bot
2026-06-04 20:10 ` Claude review: Introduce error threshold to drm_ras 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-patch2-20260604184849.1011985-3-raag.jadav@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