* Claude review: drm: rz-du: Ensure correct suspend/resume ordering with VSP
2026-03-24 18:05 [PATCH] " Tommaso Merciai
@ 2026-03-24 20:34 ` Claude Code Review Bot
2026-03-24 20:34 ` Claude Code Review Bot
1 sibling, 0 replies; 5+ messages in thread
From: Claude Code Review Bot @ 2026-03-24 20:34 UTC (permalink / raw)
To: dri-devel-reviews
Overall Series Review
Subject: drm: rz-du: Ensure correct suspend/resume ordering with VSP
Author: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Patches: 2
Reviewed: 2026-03-25T06:34:36.400945
---
This is a straightforward, single-patch series that adds a `DL_FLAG_STATELESS` device link between the RZ/G2L DU (consumer) and its VSP (supplier) to enforce correct suspend/resume ordering. The approach mirrors what was already done for R-Car DU's CMM device links in `rcar_du_kms.c`. The patch is clean, small, and well-motivated.
One issue worth raising is around the cleanup ordering and error handling.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 5+ messages in thread
* Claude review: drm: rz-du: Ensure correct suspend/resume ordering with VSP
2026-03-24 18:05 [PATCH] " Tommaso Merciai
2026-03-24 20:34 ` Claude review: " Claude Code Review Bot
@ 2026-03-24 20:34 ` Claude Code Review Bot
1 sibling, 0 replies; 5+ messages in thread
From: Claude Code Review Bot @ 2026-03-24 20:34 UTC (permalink / raw)
To: dri-devel-reviews
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2] drm: rz-du: Ensure correct suspend/resume ordering with VSP
@ 2026-03-30 14:46 Tommaso Merciai
2026-03-31 7:10 ` Claude review: " Claude Code Review Bot
2026-03-31 7:10 ` Claude Code Review Bot
0 siblings, 2 replies; 5+ messages in thread
From: Tommaso Merciai @ 2026-03-30 14:46 UTC (permalink / raw)
To: tomm.merciai, geert, laurent.pinchart
Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, dri-devel, linux-kernel, Laurent Pinchart
The VSP serves as an interface to memory and a compositor to the DU. It
therefore needs to be suspended after and resumed before the DU, to be
properly stopped and restarted in a controlled fashion driven by the DU
driver. This currently works by chance. Avoid relying on luck by
enforcing the correct suspend/resume ordering with device links.
Based on similar work done by Laurent Pinchart for R-Car DU.
commit db5be3a7d6bd ("drm: rcar-du: Ensure correct suspend/resume
ordering with VSP")
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v1->v2:
- Collected Laurent Pinchart tag.
- Added commit id of the similar work on R-Car DU.
drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c | 16 ++++++++++++++++
drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h | 2 ++
2 files changed, 18 insertions(+)
diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c
index bd486377f037..eb626c3cc421 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c
@@ -20,6 +20,7 @@
#include <drm/drm_vblank.h>
#include <linux/bitops.h>
+#include <linux/device.h>
#include <linux/dma-mapping.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
@@ -293,6 +294,9 @@ static void rzg2l_du_vsp_cleanup(struct drm_device *dev, void *res)
{
struct rzg2l_du_vsp *vsp = res;
+ if (vsp->link)
+ device_link_del(vsp->link);
+
put_device(vsp->vsp);
}
@@ -317,6 +321,18 @@ int rzg2l_du_vsp_init(struct rzg2l_du_vsp *vsp, struct device_node *np,
if (ret < 0)
return ret;
+ /*
+ * Enforce suspend/resume ordering between the DU (consumer) and the
+ * VSP (supplier). The DU will be suspended before and resume after the
+ * VSP.
+ */
+ 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;
diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h
index 322eb80dcbaf..a22aaf0843ed 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h
@@ -15,6 +15,7 @@
#include <linux/scatterlist.h>
struct device;
+struct device_link;
struct drm_framebuffer;
struct rzg2l_du_device;
struct rzg2l_du_format_info;
@@ -29,6 +30,7 @@ struct rzg2l_du_vsp_plane {
struct rzg2l_du_vsp {
unsigned int index;
struct device *vsp;
+ struct device_link *link;
struct rzg2l_du_device *dev;
};
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Claude review: drm: rz-du: Ensure correct suspend/resume ordering with VSP
2026-03-30 14:46 [PATCH v2] drm: rz-du: Ensure correct suspend/resume ordering with VSP Tommaso Merciai
@ 2026-03-31 7:10 ` Claude Code Review Bot
2026-03-31 7:10 ` Claude Code Review Bot
1 sibling, 0 replies; 5+ messages in thread
From: Claude Code Review Bot @ 2026-03-31 7:10 UTC (permalink / raw)
To: dri-devel-reviews
Overall Series Review
Subject: drm: rz-du: Ensure correct suspend/resume ordering with VSP
Author: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Patches: 1
Reviewed: 2026-03-31T17:10:16.912268
---
This is a single, straightforward patch that adds a device link between the DU (Display Unit) and the VSP (Video Signal Processor) to enforce correct suspend/resume ordering on Renesas RZ/G2L SoCs. The VSP must be suspended after and resumed before the DU, and a `DL_FLAG_STATELESS` device link achieves this.
The patch is a direct port of the same fix already present in the R-Car DU driver (`rcar_du_vsp.c:494`), as credited in the commit message. The implementation is correct and follows the established pattern exactly.
**Verdict: Patch looks good. No issues found.**
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 5+ messages in thread
* Claude review: drm: rz-du: Ensure correct suspend/resume ordering with VSP
2026-03-30 14:46 [PATCH v2] drm: rz-du: Ensure correct suspend/resume ordering with VSP Tommaso Merciai
2026-03-31 7:10 ` Claude review: " Claude Code Review Bot
@ 2026-03-31 7:10 ` Claude Code Review Bot
1 sibling, 0 replies; 5+ messages in thread
From: Claude Code Review Bot @ 2026-03-31 7:10 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
**Commit message:** Clear and well-written. Explains *why* the device link is needed (suspend/resume ordering), credits the original R-Car DU work, and includes the reference commit hash.
**Header changes (`rzg2l_du_vsp.h`):**
- Forward declaration of `struct device_link` added in correct alphabetical position.
- New `struct device_link *link` member added to `struct rzg2l_du_vsp` — correct placement alongside the existing `struct device *vsp`.
**Init path (`rzg2l_du_vsp_init`):**
```c
vsp->link = device_link_add(rcdu->dev, vsp->vsp, DL_FLAG_STATELESS);
```
- `rcdu->dev` (DU) is correctly the consumer, `vsp->vsp` is correctly the supplier.
- `DL_FLAG_STATELESS` is the right flag — it enforces suspend/resume ordering without managing the device lifecycle. This matches the R-Car DU driver.
- Error path returns `-EINVAL` with a dev_err message — appropriate.
- Placement after `drmm_add_action_or_reset()` and before `vsp1_du_init()` is correct: the cleanup action is already registered, so if `device_link_add` or `vsp1_du_init` fails, `rzg2l_du_vsp_cleanup` will be called and will properly delete the link (or skip if NULL).
**Cleanup path (`rzg2l_du_vsp_cleanup`):**
```c
if (vsp->link)
device_link_del(vsp->link);
```
- The NULL check is correct for the case where `device_link_add` failed (since cleanup is registered before the link is created).
- `device_link_del` before `put_device` is the right ordering.
**Include addition:** `<linux/device.h>` added in alphabetical order — correct.
**No issues.** The patch is a clean, minimal, well-motivated change that mirrors proven code from the R-Car DU driver.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-03-31 7:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-30 14:46 [PATCH v2] drm: rz-du: Ensure correct suspend/resume ordering with VSP Tommaso Merciai
2026-03-31 7:10 ` Claude review: " Claude Code Review Bot
2026-03-31 7:10 ` Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-03-24 18:05 [PATCH] " Tommaso Merciai
2026-03-24 20:34 ` Claude review: " Claude Code Review Bot
2026-03-24 20:34 ` Claude Code Review Bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox