From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: drm/xe/xe_hw_error: Integrate DRM RAS with hardware error handling Date: Tue, 03 Mar 2026 14:32:50 +1000 Message-ID: In-Reply-To: <20260228080858.3063532-10-riana.tauro@intel.com> References: <20260228080858.3063532-7-riana.tauro@intel.com> <20260228080858.3063532-10-riana.tauro@intel.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review **Loss of FATAL vs NONFATAL distinction in log messages:** The old code logged distinct strings ("CORRECTABLE", "NONFATAL", "FATAL"). The new code collapses NONFATAL and FATAL into "uncorrectable-errors": ```c +static enum drm_xe_ras_error_severity hw_err_to_severity(const enum hardware_error hw_err) +{ + if (hw_err == HARDWARE_ERROR_CORRECTABLE) + return DRM_XE_RAS_ERR_SEV_CORRECTABLE; + + /* Uncorrectable errors comprise of both fatal and non-fatal errors */ + return DRM_XE_RAS_ERR_SEV_UNCORRECTABLE; +} ``` While this mapping is correct for the RAS counter abstraction, using the severity string directly in kernel log messages (e.g. `"HEC FW %s %s reported"`) loses important diagnostic information. A FATAL error requiring firmware flash vs a NONFATAL error should be distinguishable in `dmesg`. Consider keeping a separate `hw_error_to_str()` for log messages while using `hw_err_to_severity()` for counter bucketing. **`hw_error_info_init` only for PVC but handler is still Battlemage-gated:** ```c +static int hw_error_info_init(struct xe_device *xe) +{ + if (xe->info.platform != XE_PVC) + return 0; + return xe_drm_ras_init(xe); +} ``` In this patch, `hw_error_source_handler` still checks `xe->info.platform != XE_BATTLEMAGE`, so Battlemage will still enter the handler but without RAS info initialized. The `info` pointer will be NULL. This is addressed in patch 4 with the `if (!info) goto clear_reg` guard, but it means this patch alone has a potential NULL dereference on Battlemage if applied independently (broken bisectability). --- --- Generated by Claude Code Patch Reviewer