From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/xe/xe_drm_ras: Add support for clear-error-counter in XE drm_ras
Date: Sun, 12 Apr 2026 11:34:40 +1000 [thread overview]
Message-ID: <review-patch2-20260409073318.2909379-6-riana.tauro@intel.com> (raw)
In-Reply-To: <20260409073318.2909379-6-riana.tauro@intel.com>
Patch Review
**Overall**: Straightforward driver-side implementation that closely follows the existing query callback pattern. No issues.
**`hw_clear_error_counter()`** correctly mirrors `hw_query_error_counter()`:
```c
static int hw_clear_error_counter(struct xe_drm_ras_counter *info, u32 error_id)
{
if (!info || !info[error_id].name)
return -ENOENT;
atomic_set(&info[error_id].counter, 0);
return 0;
}
```
The bounds safety is guaranteed by the core framework's range check (against `error_counter_range.first`/`.last`) before the callback is invoked, so the array access `info[error_id]` is safe. The `!info[error_id].name` check handles non-contiguous IDs gracefully.
**`atomic_set` for clearing** is appropriate — it matches the `atomic_read` in the query path and any `atomic_inc` in the error recording path. There is an inherent TOCTOU between clearing and the next read (a new error could arrive), but that's fundamental to the operation and not a bug.
**Code structure observation**: The `clear_uncorrectable_error_counter()` and `clear_correctable_error_counter()` functions are near-identical, differing only in the severity index used to select `ras->info[severity]`. The same duplication exists in the query callbacks. This is fine for two severities, but if more are added, a single parameterized function with a severity argument stored in the node's `priv` (or a wrapper struct) would be cleaner. Not a blocking concern for this series.
**`assign_node_params()` modification** is clean — adding braces around the existing if/else and inserting the callback assignment alongside the query callback:
```c
if (severity == DRM_XE_RAS_ERR_SEV_CORRECTABLE) {
node->query_error_counter = query_correctable_error_counter;
node->clear_error_counter = clear_correctable_error_counter;
} else {
node->query_error_counter = query_uncorrectable_error_counter;
node->clear_error_counter = clear_uncorrectable_error_counter;
}
```
No issues with this patch.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-04-12 1:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-09 7:33 [PATCH v2 0/2] Add clear-error-counter command to drm_ras Riana Tauro
2026-04-09 7:33 ` [PATCH v2 1/2] drm/drm_ras: Add clear-error-counter netlink " Riana Tauro
2026-04-09 7:21 ` Tauro, Riana
2026-04-09 13:37 ` Rodrigo Vivi
2026-04-10 5:21 ` Tauro, Riana
2026-04-09 23:01 ` Zack McKevitt
2026-04-10 5:25 ` Tauro, Riana
2026-04-12 1:34 ` Claude review: " Claude Code Review Bot
2026-04-09 7:33 ` [PATCH v2 2/2] drm/xe/xe_drm_ras: Add support for clear-error-counter in XE drm_ras Riana Tauro
2026-04-12 1:34 ` Claude Code Review Bot [this message]
2026-04-12 1:34 ` Claude review: Add clear-error-counter command to drm_ras Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-03-11 10:29 [PATCH 0/4] Add support for clear counter and error event in DRM RAS Riana Tauro
2026-03-11 10:29 ` [PATCH 2/4] drm/xe/xe_drm_ras: Add support for clear-error-counter in XE " Riana Tauro
2026-03-11 21:06 ` Claude review: " 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-20260409073318.2909379-6-riana.tauro@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