From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm: writeback: Modify drm_writeback_signal_completion helper
Date: Mon, 25 May 2026 20:57:36 +1000 [thread overview]
Message-ID: <review-patch4-20260521053708.1475129-5-suraj.kandpal@intel.com> (raw)
In-Reply-To: <20260521053708.1475129-5-suraj.kandpal@intel.com>
Patch Review
Changes `drm_writeback_signal_completion()` to take `struct drm_connector *`.
**BUG — amdgpu `dm_crtc_high_irq` uses wrong field:**
```c
- drm_writeback_signal_completion(acrtc->wb_conn, 0);
+ drm_writeback_signal_completion(acrtc->connector, 0);
```
`acrtc->connector` is a **pre-existing, unrelated field** on `struct amdgpu_crtc` — it's the general `struct drm_connector *` for the CRTC (line 502 of `amdgpu_mode.h`), which points to the display connector, NOT the writeback connector. `acrtc->wb_conn` is a `struct drm_writeback_connector *` (line 513). The correct conversion should be:
```c
drm_writeback_signal_completion(drm_writeback_to_connector(acrtc->wb_conn), 0);
```
This bug would cause writeback completion to be signalled on the **wrong connector**, potentially corrupting the display connector's fence state or crashing due to the display connector not having writeback data initialized. This would likely manifest as a NULL pointer dereference or list corruption in the job_queue when called from an IRQ handler, making it a serious bug.
Note that the surrounding code in `dm_crtc_high_irq` (lines 664-689) still accesses `acrtc->wb_conn->job_lock` and `acrtc->wb_conn->job_queue` directly, which are `drm_writeback_connector` fields — so `wb_conn` is still needed. The patch should also update those accesses if the intent is to go through `drm_connector`, or leave the signal_completion call using `drm_writeback_to_connector(acrtc->wb_conn)`.
**Minor issue:**
1. **Typo in doc comment** — "whicha" should be "which":
```c
* @connector: The drm connector whicha has the drm_writeback_connector whose
```
2. The MSM dpu code correctly uses `drm_writeback_to_connector(wb_enc->wb_conn)`:
```c
drm_writeback_signal_completion(drm_writeback_to_connector(wb_enc->wb_conn), 0);
```
This is the right pattern and highlights that the amdgpu change is wrong.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-25 10:57 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-21 5:37 [PATCH v4 0/7] Refactor drm_writeback_connector structure Suraj Kandpal
2026-05-21 5:37 ` [PATCH v4 1/7] drm: writeback: " Suraj Kandpal
2026-05-21 23:28 ` John Harrison
2026-05-25 10:57 ` Claude review: " Claude Code Review Bot
2026-05-21 5:37 ` [PATCH v4 2/7] drm: writeback: Modify writeback init helpers Suraj Kandpal
2026-05-21 23:30 ` John Harrison
2026-05-25 10:57 ` Claude review: " Claude Code Review Bot
2026-05-21 5:37 ` [PATCH v4 3/7] drm: writeback: Modify drm_writeback_queue_job helper Suraj Kandpal
2026-05-21 23:31 ` John Harrison
2026-05-25 10:57 ` Claude review: " Claude Code Review Bot
2026-05-21 5:37 ` [PATCH v4 4/7] drm: writeback: Modify drm_writeback_signal_completion helper Suraj Kandpal
2026-05-21 23:31 ` John Harrison
2026-05-25 10:57 ` Claude Code Review Bot [this message]
2026-05-21 5:37 ` [PATCH v4 5/7] drm: writeback: Modify drm_writeback_get_out_fence helper Suraj Kandpal
2026-05-21 23:35 ` John Harrison
2026-05-25 10:57 ` Claude review: " Claude Code Review Bot
2026-05-21 5:37 ` [PATCH v4 6/7] drm: writeback: Modify prepare_writeback_job helper Suraj Kandpal
2026-05-25 10:57 ` Claude review: " Claude Code Review Bot
2026-05-21 5:37 ` [PATCH v4 7/7] drm: writeback: Modify cleanup_writeback_job helper Suraj Kandpal
2026-05-25 10:57 ` Claude review: " Claude Code Review Bot
2026-05-21 18:56 ` [PATCH v4 0/7] Refactor drm_writeback_connector structure John Harrison
2026-05-22 4:21 ` Kandpal, Suraj
2026-05-25 10:57 ` Claude review: " Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-05-22 5:03 [PATCH v5 0/7] " Suraj Kandpal
2026-05-22 5:03 ` [PATCH v5 4/7] drm: writeback: Modify drm_writeback_signal_completion helper Suraj Kandpal
2026-05-25 9:19 ` 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-patch4-20260521053708.1475129-5-suraj.kandpal@intel.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