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/rcar-du: dsc: Add rudimentary Renesas R-Car V4H DSC driver
Date: Sat, 16 May 2026 10:53:55 +1000	[thread overview]
Message-ID: <review-patch3-20260514-rcar-du-dsc-v1-3-d65f7a9e9841@ideasonboard.com> (raw)
In-Reply-To: <20260514-rcar-du-dsc-v1-3-d65f7a9e9841@ideasonboard.com>

Patch Review

**Status: Has a bug and minor issues.**

**Bug - Bridge reference leak:**

```c
dsc->bridge.next_bridge = of_drm_find_and_get_bridge(remote);
of_node_put(remote);
if (!dsc->bridge.next_bridge)
    return -EPROBE_DEFER;
```

`of_drm_find_and_get_bridge()` takes a reference on the returned bridge (via `drm_bridge_get()`), but there is no corresponding `drm_bridge_put()` anywhere in the driver. There is no `.remove` callback and no devm cleanup for this reference. Compare with `rcar_du_encoder.c` which properly calls `drm_bridge_put()` on its stored bridge references during cleanup.

The existing `rcar_mipi_dsi.c` uses `devm_drm_of_get_bridge()` for its `next_bridge`, which handles cleanup automatically. This driver should do the same:

```c
dsc->bridge.next_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 1, 0);
if (IS_ERR(dsc->bridge.next_bridge))
    return dev_err_probe(dev, PTR_ERR(dsc->bridge.next_bridge),
                         "Failed to get next bridge\n");
```

Note: `devm_drm_of_get_bridge()` returns `ERR_PTR` (not NULL), so the error check would need to change accordingly.

**Minor - Error swallowing in atomic_enable:**

```c
WARN_ON(clk_prepare_enable(dsc->clk));
WARN_ON(reset_control_deassert(dsc->rst));
```

If `clk_prepare_enable()` fails, `reset_control_deassert()` still runs on a potentially non-clocked block. These should be sequenced with early return on failure. Though this pattern is common in bridge `atomic_enable` (where you can't return errors), at minimum the reset deassert should be conditional on clock enable succeeding.

**Minor - mode_valid comment:**

```c
if (mode->clock > 400000) /* Really 400 Mpixel/s */
    return MODE_CLOCK_HIGH;
```

The comment "Really 400 Mpixel/s" is slightly confusing. `mode->clock` is in kHz, so 400000 kHz = 400 MHz. For 1 pixel/clock this is indeed 400 Mpixel/s. The comment could be clearer: perhaps "400 MHz pixel clock = 400 Mpixel/s".

**Minor - mmio mapped but unused:**

```c
dsc->mmio = devm_platform_ioremap_resource(pdev, 0);
```

The `mmio` field is mapped but never read from or written to in this driver (bypass mode doesn't touch any registers). This is fine as scaffolding for future DSC encoding support, but worth noting.

---

---
Generated by Claude Code Patch Reviewer

  parent reply	other threads:[~2026-05-16  0:53 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-14 12:24 [PATCH 0/5] drm/rcar-du: Add support for DSI pipelines with DSC Tomi Valkeinen
2026-05-14 12:24 ` [PATCH 1/5] clk: renesas: r8a779g0: Add DSC clock Tomi Valkeinen
2026-05-16  0:53   ` Claude review: " Claude Code Review Bot
2026-05-14 12:24 ` [PATCH 2/5] dt-bindings: display: bridge: Document Renesas R-Car V4H DSC bindings Tomi Valkeinen
2026-05-14 13:47   ` Rob Herring (Arm)
2026-05-16  0:53   ` Claude review: " Claude Code Review Bot
2026-05-14 12:24 ` [PATCH 3/5] drm/rcar-du: dsc: Add rudimentary Renesas R-Car V4H DSC driver Tomi Valkeinen
2026-05-15  7:49   ` Geert Uytterhoeven
2026-05-15  8:02     ` Tomi Valkeinen
2026-05-15  8:05       ` Geert Uytterhoeven
2026-05-15  8:17         ` Tomi Valkeinen
2026-05-15  8:47           ` Geert Uytterhoeven
2026-05-15  9:29   ` Philipp Zabel
2026-05-16  0:53   ` Claude Code Review Bot [this message]
2026-05-14 12:24 ` [PATCH 4/5] drm/rcar-du: dsi: Support DSC in the pipeline Tomi Valkeinen
2026-05-16  0:53   ` Claude review: " Claude Code Review Bot
2026-05-14 12:24 ` [PATCH 5/5] arm64: dts: renesas: Add Renesas R-Car V4H DSC Tomi Valkeinen
2026-05-16  0:53   ` Claude review: " Claude Code Review Bot
2026-05-16  0:53 ` Claude review: drm/rcar-du: Add support for DSI pipelines with DSC Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-05-15  7:56 [PATCH v2 0/5] " Tomi Valkeinen
2026-05-15  7:56 ` [PATCH v2 3/5] drm/rcar-du: dsc: Add rudimentary Renesas R-Car V4H DSC driver Tomi Valkeinen
2026-05-15 23:46   ` Claude review: " Claude Code Review Bot
2026-05-15  9:09 [PATCH v3 0/7] drm/rcar-du: Add support for DSI pipelines with DSC Tomi Valkeinen
2026-05-15  9:09 ` [PATCH v3 3/7] drm/rcar-du: dsc: Add rudimentary Renesas R-Car V4H DSC driver Tomi Valkeinen
2026-05-15 23:29   ` 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-patch3-20260514-rcar-du-dsc-v1-3-d65f7a9e9841@ideasonboard.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