From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: accel/amdxdna: Reduce log noise during process termination Date: Wed, 11 Feb 2026 16:21:02 +1000 Message-ID: In-Reply-To: <20260210164521.1094274-3-mario.limonciello@amd.com> References: <20260210164521.1094274-1-mario.limonciello@amd.com> <20260210164521.1094274-3-mario.limonciello@amd.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Mailer: Claude Code Patch Reviewer Patch Review **Summary:** Reasonable intent but implementation could be improved. **Issues:** 1. **Inconsistent error code checking pattern:** In `aie2_ctx.c`: ```c - if (ret) + if (ret && ret != -ENODEV) XDNA_ERR(xdna, "Destroy temporal only context failed, ret %d", ret); ``` This silently swallows `-ENODEV` errors even though the function description says they should be downgraded to debug level. There's no debug message added here unlike in the other locations. 2. **Logic error in dma_resv_wait_timeout handling:** ```c ret = dma_resv_wait_timeout(gobj->resv, DMA_RESV_USAGE_BOOKKEEP, true, MAX_SCHEDULE_TIMEOUT); - if (!ret || ret == -ERESTARTSYS) + if (!ret) XDNA_ERR(xdna, "Failed to wait for bo, ret %ld", ret); + else if (ret == -ERESTARTSYS) + XDNA_DBG(xdna, "Wait for bo interrupted by signal"); ``` The `dma_resv_wait_timeout()` function returns: - `> 0`: Success (remaining timeout in jiffies) - `0`: Timeout - `< 0`: Error code The original code treated both timeout (`!ret`) and signal interruption (`-ERESTARTSYS`) as errors. The new code only prints an error for timeout but adds debug for signals. However, there's a subtle issue: what if there are other error codes besides `-ERESTARTSYS`? They would be silently ignored. A better pattern would be: ```c if (ret > 0) { // Success - do nothing } else if (ret == 0) { XDNA_ERR(xdna, "Timeout waiting for bo"); } else if (ret == -ERESTARTSYS) { XDNA_DBG(xdna, "Wait for bo interrupted by signal"); } else { XDNA_ERR(xdna, "Failed to wait for bo, ret %ld", ret); } ``` 3. **Same Fixes tag issue:** ``` Fixes: 97f27573837e ("accel/amdxdna: Fix potential NULL pointer dereference in context cleanup") ``` This tag references a commit that doesn't seem to be the root cause of log noise - it's the NULL pointer fix. The Fixes tag should reference the commit that introduced the noisy logging, not the previous patch in this series. 4. **Missing context in commit message:** The commit message doesn't explain *how* the submitter determined these are "expected" conditions. For example: - How often does `-ERESTARTSYS` occur during normal termination? - Are there cases where `-ERESTARTSYS` indicates a real problem? - Same questions for `-ENODEV` **Positive aspects:** - The intent is correct - reducing log noise for expected conditions - The debug messages are informative - Reviewed-by tag from Lizhi Hou shows maintainer approval (for this patch specifically) **Recommendation:** This patch should be reworked to: 1. Add consistent debug logging for all downgraded errors 2. Fix the error handling logic in `aie2_hmm_invalidate()` 3. Correct the Fixes tag 4. Provide more context about when these conditions occur --- Generated by Claude Code Patch Reviewer