public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm: rz-du: Ensure correct suspend/resume ordering with VSP
Date: Wed, 25 Mar 2026 06:34:36 +1000	[thread overview]
Message-ID: <review-patch1-20260324180512.2277875-1-tommaso.merciai.xr@bp.renesas.com> (raw)
In-Reply-To: <20260324180512.2277875-1-tommaso.merciai.xr@bp.renesas.com>

Patch Review

**Correctness of the device link direction:** The call `device_link_add(rcdu->dev, vsp->vsp, DL_FLAG_STATELESS)` correctly makes the DU the consumer and the VSP the supplier. With `DL_FLAG_STATELESS`, the PM core ensures the supplier (VSP) is resumed before and suspended after the consumer (DU). This matches the commit message and comment.

**Cleanup concern — resource leak on `vsp1_du_init()` failure:**
The device link is created *before* calling `vsp1_du_init()`:

```c
+	vsp->link = device_link_add(rcdu->dev, vsp->vsp, DL_FLAG_STATELESS);
+	if (!vsp->link) {
+		dev_err(rcdu->dev, "Failed to create device link to VSP %s\n",
+			dev_name(vsp->vsp));
+		return -EINVAL;
+	}
+
 	ret = vsp1_du_init(vsp->vsp);
 	if (ret < 0)
 		return ret;
```

If `vsp1_du_init()` fails, the function returns an error. The cleanup action `rzg2l_du_vsp_cleanup` (registered via `drmm_add_action_or_reset` earlier) will eventually run and correctly delete the link since the patch adds the `device_link_del(vsp->link)` call there. So this is actually fine — the `drmm` cleanup handles it.

**Minor style observation:** The R-Car DU CMM code uses a local `struct device_link *link` variable rather than storing it in a struct, because the CMM links are never explicitly deleted (they live for the lifetime of the device). Here, you store `vsp->link` and explicitly delete it in cleanup, which is a reasonable design choice given the `drmm` managed lifecycle. However, with `DL_FLAG_STATELESS` device links, the link is automatically cleaned up when either the consumer or supplier device is unregistered. Since the DU device is the consumer and owns the lifecycle, the explicit `device_link_del` in cleanup is arguably redundant — but it's also harmless and makes the intent clear. No change needed.

**Include ordering:** `#include <linux/device.h>` is added in alphabetical order — correct.

**Header forward declaration:** `struct device_link;` is added in the correct alphabetical position in the header — correct.

**Struct field placement:** `struct device_link *link` is added after `struct device *vsp` which is a logical grouping — fine.

**Overall:** The patch is correct and clean. No blocking issues. It would be worth confirming with Laurent Pinchart whether he also planned to port the R-Car DU VSP device link (not just CMM) to the rz-du driver, since the R-Car DU VSP code itself doesn't appear to use device links currently — this patch adds functionality that goes beyond what the R-Car DU VSP has.

---
Generated by Claude Code Patch Reviewer

  parent reply	other threads:[~2026-03-24 20:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-24 18:05 [PATCH] drm: rz-du: Ensure correct suspend/resume ordering with VSP Tommaso Merciai
2026-03-24 19:33 ` Laurent Pinchart
2026-03-24 20:34 ` Claude Code Review Bot [this message]
2026-03-24 20:34 ` 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-20260324180512.2277875-1-tommaso.merciai.xr@bp.renesas.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