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/bridge: dw-hdmi: move next_bridge lookup to attach time
Date: Sun, 12 Apr 2026 13:37:35 +1000	[thread overview]
Message-ID: <review-patch7-20260407-drm-lcdif-dbanc-v4-7-247a16e61ef9@bootlin.com> (raw)
In-Reply-To: <20260407-drm-lcdif-dbanc-v4-7-247a16e61ef9@bootlin.com>

Patch Review

This is a key patch that resolves the devlink chicken-egg problem. The moved logic looks correct:

```c
+	if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
+		struct device_node *remote __free(device_node) =
+			of_graph_get_remote_node(hdmi->dev->of_node,
+						 hdmi->plat_data->output_port, -1);
+		if (!remote)
+			return -ENODEV;
+
+		struct drm_bridge *next_bridge __free(drm_bridge_put) =
+			of_drm_find_and_get_bridge(remote);
+		if (!next_bridge)
+			return -EPROBE_DEFER;
+
+		return drm_bridge_attach(encoder, next_bridge, bridge, flags);
+	}
```

**Concern**: The `next_bridge` is declared with `__free(drm_bridge_put)`, which means `drm_bridge_put()` will be called when the variable goes out of scope (i.e., after `drm_bridge_attach()` returns). `drm_bridge_attach()` adds the bridge to the encoder's bridge chain via `list_add_tail`, which means the bridge chain holds a reference to it. The question is whether `drm_bridge_attach()` takes its own reference on the bridge.

Looking at the existing code at probe time, the original `dw_hdmi_parse_dt()` stored the result of `of_drm_find_and_get_bridge()` in `hdmi->bridge.next_bridge` and never put it. With the new code, `of_drm_find_and_get_bridge()` takes a reference, then `__free(drm_bridge_put)` drops it after attach. If `drm_bridge_attach()` takes its own reference internally (which is the case with the new refcounted bridge infrastructure), this should be fine. Given that this codebase has clearly moved to refcounted bridges (v6.17+), and `drm_bridge_attach()` does get a reference, this pattern should be correct.

No blocking issues.

---

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-04-12  3:37 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-07 12:24 [PATCH v4 00/11] drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector Luca Ceresoli
2026-04-07 12:24 ` [PATCH v4 01/11] drm/mxsfb/lcdif: simplify remote pointer management using __free Luca Ceresoli
2026-04-12  3:37   ` Claude review: " Claude Code Review Bot
2026-04-07 12:24 ` [PATCH v4 02/11] drm/mxsfb/lcdif: simplify ep " Luca Ceresoli
2026-04-12  3:37   ` Claude review: " Claude Code Review Bot
2026-04-07 12:24 ` [PATCH v4 03/11] drm/mxsfb/lcdif: use dev_err_probe() consistently in lcdif_attach_bridge Luca Ceresoli
2026-04-12  3:37   ` Claude review: " Claude Code Review Bot
2026-04-07 12:24 ` [PATCH v4 04/11] drm/mxsfb/lcdif: move iteration-specific variables declaration inside loop " Luca Ceresoli
2026-04-12  3:37   ` Claude review: " Claude Code Review Bot
2026-04-07 12:24 ` [PATCH v4 05/11] drm/bridge: dw-hdmi: document the output_port field Luca Ceresoli
2026-04-12  3:37   ` Claude review: " Claude Code Review Bot
2026-04-07 12:24 ` [PATCH v4 06/11] drm/bridge: dw-hdmi: warn on unsupported attach combination Luca Ceresoli
2026-04-12  3:37   ` Claude review: " Claude Code Review Bot
2026-04-07 12:24 ` [PATCH v4 07/11] drm/bridge: dw-hdmi: move next_bridge lookup to attach time Luca Ceresoli
2026-04-12  3:37   ` Claude Code Review Bot [this message]
2026-04-07 12:24 ` [PATCH v4 08/11] drm/bridge: imx8mp-hdmi-tx-connector-fixup: add an hdmi-connector when missing using a DT overlay at boot time Luca Ceresoli
2026-04-08  2:58   ` Liu Ying
2026-04-12  3:37   ` Claude review: " Claude Code Review Bot
2026-04-07 12:24 ` [PATCH v4 09/11] drm/bridge: imx8mp-hdmi-tx-connector-fixup: show a warning when adding the overlay Luca Ceresoli
2026-04-12  3:37   ` Claude review: " Claude Code Review Bot
2026-04-07 12:24 ` [PATCH v4 10/11] drm/bridge: imx8mp-hdmi-tx: switch to DRM_BRIDGE_ATTACH_NO_CONNECTOR Luca Ceresoli
2026-04-12  3:37   ` Claude review: " Claude Code Review Bot
2026-04-07 12:24 ` [PATCH v4 11/11] drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector Luca Ceresoli
2026-04-08  3:01   ` Liu Ying
2026-04-12  3:37   ` Claude review: " Claude Code Review Bot
2026-04-12  3:37 ` Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-03-30 19:25 [PATCH v2 00/10] " Luca Ceresoli
2026-03-30 19:25 ` [PATCH v2 07/10] drm/bridge: dw-hdmi: move next_bridge lookup to attach time Luca Ceresoli
2026-03-31  6:54   ` Claude review: " Claude Code Review Bot
2026-03-20 10:46 [PATCH 0/8] drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector Luca Ceresoli
2026-03-20 10:46 ` [PATCH 6/8] drm/bridge: dw-hdmi: move next_bridge lookup to attach time Luca Ceresoli
2026-03-21 17:48   ` 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-patch7-20260407-drm-lcdif-dbanc-v4-7-247a16e61ef9@bootlin.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