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_ras: Add support for error counter Date: Fri, 05 Jun 2026 06:10:07 +1000 Message-ID: In-Reply-To: <20260604184849.1011985-3-raag.jadav@intel.com> References: <20260604184849.1011985-1-raag.jadav@intel.com> <20260604184849.1011985-3-raag.jadav@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 Marked "Do not review, CI only" =E2=80=94 I'll note substantive issues only. **Issues:** 1. **`get_counter` doesn't check `response.status`**: In `get_counter()`: ```c common =3D &response.counter.common; *value =3D response.value; ``` It reads the response value without checking any status field. Compare with= `xe_ras_clear_counter()` which does: ```c ret =3D ras_status_to_errno(response.status); if (ret) { ... } ``` The `xe_ras_get_counter_response` struct does have a `threshold` field but = no explicit `status` field, while `xe_ras_clear_counter_response` has a `st= atus` field. If the firmware can report errors in the get-counter response,= this is a bug. If the protocol doesn't include status in get-counter respo= nses, then the structures are correct but the asymmetry should be documente= d. 2. **Probe order change**: The patch moves `xe_soc_remapper_init()` and `xe= _sysctrl_init()` earlier in `xe_device_probe()`, before display and GT init= ialization. The commit message doesn't explain why this reordering is neede= d. Moving init earlier could introduce regressions if the remapper/sysctrl = depends on state set up between the old and new positions. 3. **Mixed initialization style**: Uses `=3D {0}` throughout: ```c struct xe_ras_get_counter_response response =3D {0}; ``` While patch 3 uses `=3D {}`. Should be consistent; `=3D {}` is the preferre= d kernel style. 4. **`xe_ras_get_counter` parameter name mismatch**: The function signature= uses `component` as the third parameter, but the caller (`query_error_coun= ter` in `xe_drm_ras.c`) passes `error_id`: ```c return xe_ras_get_counter(xe, severity, error_id, val); ``` This works because the DRM RAS error_id IS the component enum value, but th= e naming conflation is confusing. The `query_error_counter` callback receiv= es `error_id` (which ranges over the counter range, which is set to `DRM_XE= _RAS_ERR_COMP_CORE_COMPUTE..DRM_XE_RAS_ERR_COMP_MAX-1`), and `xe_ras_get_co= unter` calls it `component`. Naming it consistently would help. 5. **Large reserved array in `xe_ras_get_counter_response`**: ```c u32 reserved[57]; ``` That's 228 bytes of reserved space. This is a protocol struct for a mailbox= command =E2=80=94 presumably the firmware defines this layout. If so, fine= , but it's unusual to see such large reserved fields and it suggests the st= ruct mirrors a fixed-size mailbox buffer rather than the actual response pa= yload. --- Generated by Claude Code Patch Reviewer