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/ras: Introduce error threshold Date: Fri, 05 Jun 2026 06:10:07 +1000 Message-ID: In-Reply-To: <20260604184849.1011985-2-raag.jadav@intel.com> References: <20260604184849.1011985-1-raag.jadav@intel.com> <20260604184849.1011985-2-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 This patch adds the core DRM RAS infrastructure for threshold queries. It f= ollows the existing error counter pattern closely. **Looks good:** - The netlink policy tables, ops registrations, and `GENL_ADMIN_PERM` flags= are all correct. - Error handling with `genlmsg_cancel`/`nlmsg_free` on failure is done prop= erly (addressed from v2 review). - Documentation is clear and includes examples. **Issues:** 1. **Missing locking around `xa_load` in threshold functions**: `get_node_e= rror_threshold()` and `set_node_error_threshold()` call `xa_load()` on the = shared xarray without any locking, same as the existing counter code. While= this is consistent with the existing pattern, `set_error_threshold` is a w= rite path =E2=80=94 if concurrent set/get is expected, consider whether the= driver callbacks need to be thread-safe (the docs should mention this resp= onsibility). This is an existing issue inherited from the counter path, but= worth documenting for the new threshold callbacks since set introduces a m= utation operation that didn't exist with query-only. 2. **`query_error_threshold` callback signature asymmetry**: The `query_err= or_threshold` callback returns the `name` output parameter, but `set_error_= threshold` does not take a name. This means `get_node_error_threshold` vali= dates the error ID range AND asks the driver for the name, while `set_node_= error_threshold` validates the range and just calls the driver. This is fin= e architecturally, but the name output from `query_error_threshold` exists = only to populate the netlink reply =E2=80=94 it would be cleaner to separat= e the "get name" concern from the "get threshold" concern, or document why = they're coupled. 3. **`set-error-threshold` YAML spec has no reply section**: ```yaml - name: set-error-threshold doc: >- Set error threshold of a given counter. attribute-set: error-counter-attrs flags: [admin-perm] do: request: attributes: - node-id - error-id - error-threshold ``` There's no `reply:` block. This is fine if the intent is to return nothing = on success (like `clear-error-counter`), but worth confirming that the gene= rated code matches expectations. 4. **`get-error-threshold` spec missing `node-id` in reply**: The reply att= ributes are `error-id`, `error-name`, `error-threshold` =E2=80=94 which mat= ches `msg_reply_threshold()`. But it's inconsistent with `get-error-counter= ` which also doesn't include `node-id` in the reply, so this is consistent = with the existing pattern. --- Generated by Claude Code Patch Reviewer