From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/xe/xe_hw_error: Add support for PVC SoC errors
Date: Tue, 03 Mar 2026 14:32:51 +1000 [thread overview]
Message-ID: <review-patch5-20260228080858.3063532-12-riana.tauro@intel.com> (raw)
In-Reply-To: <20260228080858.3063532-12-riana.tauro@intel.com>
Patch Review
**Fragile "Undefined" string comparison:**
```c
+ if (strcmp(name, "Undefined")) {
+ ...
+ atomic_inc(&info[index].counter);
+ }
```
Using `strcmp` against a magic string to skip entries is error-prone. If someone typos "Undefined" in one of the tables, errors would be silently miscounted. Use `NULL` entries and a `NULL` check instead, consistent with how other kernel error tables work.
**Correctable SoC errors silently cleared without logging or counting:**
```c
+ if (hw_err == HARDWARE_ERROR_CORRECTABLE) {
+ xe_mmio_write32(mmio, SOC_GLOBAL_ERR_STAT_REG(master, hw_err), REG_GENMASK(31, 0));
+ xe_mmio_write32(mmio, SOC_LOCAL_ERR_STAT_REG(master, hw_err), REG_GENMASK(31, 0));
+ xe_mmio_write32(mmio, SOC_GLOBAL_ERR_STAT_REG(slave, hw_err), REG_GENMASK(31, 0));
+ xe_mmio_write32(mmio, SOC_LOCAL_ERR_STAT_REG(slave, hw_err), REG_GENMASK(31, 0));
+ goto unmask_gsysevtctl;
+ }
```
The registers are cleared with all-ones without first reading them to determine which errors occurred. No counter is incremented and no log message is produced. This makes the correctable SoC error counter permanently zero, which defeats the purpose of exposing it via RAS. At minimum, the registers should be read and counted before clearing.
**Magic unmask value:**
```c
+ xe_mmio_write32(mmio, SOC_GSYSEVTCTL_REG(master, slave, i),
+ (HARDWARE_ERROR_MAX << 1) + 1);
```
`(HARDWARE_ERROR_MAX << 1) + 1` = `(3 << 1) + 1` = `7` = `0b111`. This enables all three error types (correctable, nonfatal, fatal). This should be a named constant with a comment explaining the register field layout.
**`SOC_IEH0_LOCAL_ERR_STATUS` and `SOC_IEH1_LOCAL_ERR_STATUS` both `REG_BIT(0)`:**
```c
+#define SOC_IEH0_LOCAL_ERR_STATUS REG_BIT(0)
+#define SOC_IEH1_LOCAL_ERR_STATUS REG_BIT(0)
```
Two different names for the exact same bit value is confusing. If these are the same bit in different registers, a single define with a clear name (or a comment explaining the distinction) would be better.
**Potential over-counting from global + local register processing:**
In `soc_slave_ieh_handler` and the master handler, both the local error register bits and global error register bits are iterated, and each calls `log_soc_error()` which increments the counter. If a single error event sets bits in both registers, the counter is incremented multiple times. Clarify whether this is the intended behavior.
**`slave` variable declared but only used as a constant:**
```c
+ u32 master, slave, regbit;
+ ...
+ master = SOC_PVC_MASTER_BASE;
+ slave = SOC_PVC_SLAVE_BASE;
```
These are compile-time constants. Consider using the defines directly or making them `const`.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-03-03 4:32 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-28 8:08 [PATCH v9 0/5] Introduce DRM_RAS using generic netlink for RAS Riana Tauro
2026-02-28 8:08 ` [PATCH v9 1/5] drm/ras: Introduce the DRM RAS infrastructure over generic netlink Riana Tauro
2026-02-28 16:04 ` Jakub Kicinski
2026-03-03 4:32 ` Claude review: " Claude Code Review Bot
2026-02-28 8:08 ` [PATCH v9 2/5] drm/xe/xe_drm_ras: Add support for XE DRM RAS Riana Tauro
2026-03-03 4:32 ` Claude review: " Claude Code Review Bot
2026-02-28 8:08 ` [PATCH v9 3/5] drm/xe/xe_hw_error: Integrate DRM RAS with hardware error handling Riana Tauro
2026-03-03 4:32 ` Claude review: " Claude Code Review Bot
2026-02-28 8:08 ` [PATCH v9 4/5] drm/xe/xe_hw_error: Add support for Core-Compute errors Riana Tauro
2026-03-03 4:32 ` Claude review: " Claude Code Review Bot
2026-02-28 8:08 ` [PATCH v9 5/5] drm/xe/xe_hw_error: Add support for PVC SoC errors Riana Tauro
2026-03-03 4:32 ` Claude Code Review Bot [this message]
2026-03-03 4:32 ` Claude review: Introduce DRM_RAS using generic netlink for RAS Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-03-04 7:44 [PATCH v10 0/5] " Riana Tauro
2026-03-04 7:44 ` [PATCH v10 5/5] drm/xe/xe_hw_error: Add support for PVC SoC errors Riana Tauro
2026-03-05 3:47 ` Claude review: " Claude Code Review Bot
2026-02-23 6:05 [PATCH v8 0/5] Introduce DRM_RAS using generic netlink for RAS Riana Tauro
2026-02-23 6:05 ` [PATCH v8 5/5] drm/xe/xe_hw_error: Add support for PVC SoC errors Riana Tauro
2026-02-24 0:45 ` 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-patch5-20260228080858.3063532-12-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