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

Patch Review

This adds `xe_ras_get_threshold()` and `xe_ras_set_threshold()` using system controller mailbox commands.

**Issues:**

1. **`xe_ras_get_threshold` doesn't check `response.status`**: Same issue as `get_counter` in patch 2. The `xe_ras_get_threshold_response` struct doesn't have an explicit `status` field, so either the firmware doesn't report errors in get responses (which seems unlikely), or the status is embedded in the response somehow but not checked. Meanwhile `xe_ras_set_threshold` properly checks `response.status`. This inconsistency is suspicious — if get-threshold can fail (invalid component, hardware error), how does the firmware signal that?

2. **Inconsistent `guard(xe_pm_runtime)` placement**: In `xe_ras_get_threshold()`, the guard is placed just before the `xe_sysctrl_send_command` call:
```c
	guard(xe_pm_runtime)(xe);
	ret = xe_sysctrl_send_command(&xe->sc, &command, &len);
```
But the subsequent code that reads from `response` (which was populated by the command) runs after the guard scope. Actually, since `guard()` holds until scope exit, this is fine — but it's worth noting that the runtime PM is held across the entire rest of the function including the debug print.

3. **`xe_ras_get_threshold_response` field layout concern**:
```c
struct xe_ras_get_threshold_response {
	struct xe_ras_error_class counter;
	u32 threshold;
	u32 reserved[4];
} __packed;
```
vs `xe_ras_set_threshold_response`:
```c
struct xe_ras_set_threshold_response {
	struct xe_ras_error_class counter;
	u32 reserved;
	u32 threshold;
	u32 status;
	u32 reserved1[2];
} __packed;
```
In the get response, `threshold` is right after `counter`. In the set response, there's a `reserved` field between `counter` and `threshold`. These are different mailbox commands so different layouts are expected, but the inconsistency should be verified against the firmware interface spec.

---
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 review: " Claude Code Review Bot
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 Code Review Bot [this message]
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-patch3-20260604184849.1011985-4-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