From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: Re: [PATCH] drm/amd/amdgpu: remove duplicated code in gfx_v11 and gfx_v12
Date: Tue, 05 May 2026 10:53:47 +1000 [thread overview]
Message-ID: <review-patch1-dda47c3b-1303-4f10-b375-1f3eab032ee5@amd.com> (raw)
In-Reply-To: <dda47c3b-1303-4f10-b375-1f3eab032ee5@amd.com>
Patch Review
**Tag ordering (must fix):**
The current trailer block is:
```
Signed-off-by: Ulisses Paixao <ulissespaixao@usp.br>
Co-developed-by: Felipe Sousa <felipesousa@usp.br>
Signed-off-by: Felipe Sousa <felipesousa@usp.br>
```
Per [Documentation/process/submitting-patches.rst](https://www.kernel.org/doc/html/latest/process/submitting-patches.html#when-to-use-acked-by-cc-and-co-developed-by), every `Co-developed-by:` must be immediately followed by the corresponding `Signed-off-by:`, and the submitter's `Signed-off-by:` must be last. The correct ordering is:
```
Co-developed-by: Felipe Sousa <felipesousa@usp.br>
Signed-off-by: Felipe Sousa <felipesousa@usp.br>
Signed-off-by: Ulisses Paixao <ulissespaixao@usp.br>
```
**`BUG()` in default case (should fix):**
```c
default:
BUG();
break;
```
This is an interrupt handler context. `BUG()` will panic the kernel, which is disproportionate for receiving an unexpected `me_id` value. The newer `gfx_v12_1_handle_priv_fault` already handles this more gracefully:
```c
default:
dev_dbg(adev->dev, "Unexpected me %d in priv_fault\n", me_id);
break;
```
Since this function is being promoted to shared infrastructure, this is the right time to replace `BUG()` with `WARN_ONCE()` or `dev_err()` — something that logs the problem without crashing the machine.
**Incomplete consolidation (minor, worth mentioning in commit message):**
The tree also has `handle_priv_fault` in:
- `gfx_v10_0.c` — nearly identical, only missing the `!adev->gfx.disable_kq` guard
- `gfx_v12_1.c` — different (has `xcc_id` / multi-XCC logic, no gfx ring case)
The commit message should mention why these aren't included. For `gfx_v10_0`, the `disable_kq` guard is likely just a missing backport — wrapping it in the same shared function (which has the guard) might even be a bugfix. Worth investigating.
**Kernel-doc comment trailing whitespace:**
```c
+ * amdgpu_gfx_handle_priv_fault - Handle privileged instruction fault
+ *
+ * @adev: amdgpu_device pointer
+ * @entry: interrupt vector entry from the hardware
+ *
```
Lines 3 and 5 of the doc comment (the blank lines marked with ` * `) have trailing whitespace after the `*`. These should be just ` *` with no trailing space. Some CI checks flag this.
**Code correctness:**
The consolidated function itself is a faithful copy of the originals. The extraction into `amdgpu_gfx.c` is placed logically after `amdgpu_gfx_enable_kgq()` near other queue-management code. The declaration in `amdgpu_gfx.h` is placed alphabetically near related functions. The callers in both `gfx_v11_0.c` and `gfx_v12_0.c` are updated correctly across all three IRQ handlers (`priv_reg_irq`, `bad_op_irq`, `priv_inst_irq`).
No functional change for v11 and v12 — this is a clean refactor.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-05 0:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-29 17:36 [PATCH] drm/amd/amdgpu: remove duplicated code in gfx_v11 and gfx_v12 Ulisses Paixao
2026-04-30 6:21 ` Christian König
2026-05-05 0:53 ` Claude Code Review Bot [this message]
2026-05-05 0:53 ` Claude review: " Claude Code Review Bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=review-patch1-dda47c3b-1303-4f10-b375-1f3eab032ee5@amd.com \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox