From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/xe/drm_ras: Wire up error threshold callbacks
Date: Fri, 05 Jun 2026 06:10:08 +1000 [thread overview]
Message-ID: <review-patch4-20260604184849.1011985-5-raag.jadav@intel.com> (raw)
In-Reply-To: <20260604184849.1011985-5-raag.jadav@intel.com>
Patch Review
This wires the threshold callbacks into the correctable error node only.
**Issues:**
1. **Threshold only wired for correctable, not uncorrectable**: This is the biggest issue with this patch. The `assign_node_params` function handles both correctable and uncorrectable severity:
```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;
+ node->query_error_threshold = query_correctable_error_threshold;
+ node->set_error_threshold = set_correctable_error_threshold;
} else {
node->query_error_counter = query_uncorrectable_error_counter;
node->clear_error_counter = clear_uncorrectable_error_counter;
}
```
No `query_uncorrectable_error_threshold` or `set_uncorrectable_error_threshold` is added for the else branch. The core drm_ras code (patch 1) already returns `-EOPNOTSUPP` when the callbacks are NULL, so this won't crash — but the commit message doesn't explain why threshold is only meaningful for correctable errors. If this is intentional (e.g., hardware only supports threshold for correctable errors), it should be stated in the commit message.
2. **Redundant validation**: The `query_correctable_error_threshold` callback does its own validation:
```c
if (!info || !info[error_id].name)
return -ENOENT;
if (!xe->info.has_sysctrl)
return -EOPNOTSUPP;
```
But the core `get_node_error_threshold()` in patch 1 already validates:
- The node exists (xa_load)
- The callback exists (returns `-EOPNOTSUPP` if NULL)
- The error_id is in range
The `!info || !info[error_id].name` check is still useful as driver-level validation (the counter may not be defined for that ID even if it's in range). The `has_sysctrl` check is also correct since threshold requires the mailbox. This is fine, just noting the defense-in-depth.
3. **The callback functions access `ras->info[severity]` directly**: This re-fetches the counter info array that was set up in `assign_node_params`. There's no lock protecting this access. If `cleanup_node_param` could race with a netlink request (e.g., during driver unload while a user is querying), this could be a use-after-free. This is an existing issue with the counter callbacks too, not introduced by this patch.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-06-04 20:10 UTC|newest]
Thread overview: 11+ 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 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 Code Review Bot [this message]
2026-06-04 20:10 ` Claude review: Introduce error threshold to drm_ras Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-05-12 19:16 [PATCH v2 0/9] " Raag Jadav
2026-05-12 19:16 ` [PATCH v2 7/9] drm/xe/drm_ras: Wire up error threshold callbacks Raag Jadav
2026-05-16 2:54 ` 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-patch4-20260604184849.1011985-5-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