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_drm_ras: Add error-event support in XE DRM RAS Date: Thu, 12 Mar 2026 07:06:13 +1000 Message-ID: In-Reply-To: <20260311102913.3387468-10-riana.tauro@intel.com> References: <20260311102913.3387468-6-riana.tauro@intel.com> <20260311102913.3387468-10-riana.tauro@intel.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review **Critical concern =E2=80=94 `error_id` and `ras` variable scope in `gt_hw_= error_handler`:** ```c xe_drm_ras_notify(ras, error_id, severity, GFP_ATOMIC); ``` This is called at the end of `gt_hw_error_handler`. Looking at the patch co= ntext, `ras` and `error_id` are local variables in that function. The `erro= r_id` appears to be derived from the error vector processing loop above. Ho= wever, by the time we reach the notify call at the end of the function (aft= er the loop), `error_id` holds the *last* error ID that was processed. If m= ultiple error IDs triggered simultaneously, only the last one gets notified= . This seems like a bug =E2=80=94 the notification should likely be inside = the loop body, so each error ID triggers its own notification. **Same concern in `soc_hw_error_handler`:** ```c xe_drm_ras_notify(ras, error_id, severity, GFP_ATOMIC); ``` Again called after the loop, so only the last processed `error_id` gets not= ified. The same fix would apply =E2=80=94 move the notification inside the = error processing loop. **`GFP_ATOMIC` usage is correct** since both `gt_hw_error_handler` and `soc= _hw_error_handler` are called from interrupt context (under `spin_lock_irqs= ave` in `hw_error_source_handler`). **`xe_drm_ras_notify` wrapper is thin but useful:** ```c void xe_drm_ras_notify(struct xe_drm_ras *ras, u32 error_id, const enum drm_xe_ras_error_severity severity, gfp_t= flags) { struct drm_ras_node *node =3D &ras->node[severity]; drm_ras_error_notify(node, error_id, flags); } ``` This provides a clean mapping from the XE-specific severity-based node arra= y to the generic DRM RAS node. The `const` on the `severity` parameter in t= he declaration is unnecessary (it's a value parameter) but harmless. **Missing bounds check on `severity`:** If an invalid `severity` value is p= assed, `ras->node[severity]` would access out of bounds. The callers curren= tly pass values derived from `hw_err_to_severity()` which should be safe, b= ut a defensive check wouldn't hurt. --- Generated by Claude Code Patch Reviewer