From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/rockchip: cdn-dp: Add multiple bridges to support PHY port selection
Date: Thu, 05 Mar 2026 13:38:01 +1000 [thread overview]
Message-ID: <review-patch7-20260304094152.92-8-kernel@airkyi.com> (raw)
In-Reply-To: <20260304094152.92-8-kernel@airkyi.com>
Patch Review
The most complex patch. Introduces `cdn_dp_bridge` wrapper, multi-bridge registration, port switching, HPD notification.
**Bug: `prev_port` is used uninitialized in `cdn_dp_bridge_edid_read()`:**
```c
struct cdn_dp_port *prev_port;
...
if (dp->bridge_count > 1 && !port->phy_enabled) {
for (i = 0; i < dp->bridge_count; i++) {
if (dp->bridge_list[i] != dp_bridge && dp->bridge_list[i]->enabled)
goto get_cache;
if (dp->port[i]->phy_enabled)
prev_port = dp->port[i];
}
if (prev_port) { // <--- prev_port may be uninitialized!
```
If no port has `phy_enabled` set, `prev_port` is never assigned but is still checked. The compiler may or may not zero-initialize it. This must be initialized to `NULL`.
**Issue (medium): `cdn_dp_connected_port()` has a logic issue with the extcon (non-next_bridge) path:**
```c
for (i = 0; i < dp->ports; i++) {
port = dp->port[i];
lanes[i] = cdn_dp_get_port_lanes(port);
if (!dp->next_bridge_valid)
return port;
}
```
In the extcon path (`!next_bridge_valid`), this returns the first port unconditionally regardless of whether it has lanes. The old code was:
```c
lanes = cdn_dp_get_port_lanes(port);
if (lanes)
return port;
```
The new code removed the `lanes` check for the extcon path, so it returns the first port even if it has 0 lanes. This is a regression.
**Issue (minor): `dp->active` check in `cdn_dp_switch_port()` is confusing:**
```c
static int cdn_dp_switch_port(...) {
if (dp->active)
return 0;
```
Returning 0 (success) when `dp->active` is true seems wrong for a "switch port" operation. The caller expects to be able to switch, but if the DP is actively streaming, this silently does nothing. A return of `-EBUSY` or at least a log message would be more appropriate.
**Issue (minor): In the HPD notify path, `bridge_list[i]->connected` is set but `dp->connected` is the main connection state.** The interaction between per-bridge `connected` and the global `dp->connected` is subtle and deserves a comment.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-03-05 3:38 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-04 9:41 [PATCH v15 0/9] Add Type-C DP support for RK3399 EVB IND board Chaoyi Chen
2026-03-04 9:41 ` [PATCH v15 1/9] drm/bridge: Implement generic USB Type-C DP HPD bridge Chaoyi Chen
2026-03-05 3:37 ` Claude review: " Claude Code Review Bot
2026-03-04 9:41 ` [PATCH v15 2/9] drm/bridge: aux: Add drm_aux_bridge_register_from_node() Chaoyi Chen
2026-03-05 3:37 ` Claude review: " Claude Code Review Bot
2026-03-04 9:41 ` [PATCH v15 3/9] dt-bindings: phy: rockchip: rk3399-typec-phy: Support mode-switch Chaoyi Chen
2026-03-05 3:38 ` Claude review: " Claude Code Review Bot
2026-03-04 9:41 ` [PATCH v15 4/9] phy: rockchip: phy-rockchip-typec: Add typec_mux/typec_switch support Chaoyi Chen
2026-03-05 3:38 ` Claude review: " Claude Code Review Bot
2026-03-04 9:41 ` [PATCH v15 5/9] phy: rockchip: phy-rockchip-typec: Add DRM AUX bridge Chaoyi Chen
2026-03-05 3:38 ` Claude review: " Claude Code Review Bot
2026-03-04 9:41 ` [PATCH v15 6/9] drm/rockchip: cdn-dp: Support handle lane info without extcon Chaoyi Chen
2026-03-05 3:38 ` Claude review: " Claude Code Review Bot
2026-03-04 9:41 ` [PATCH v15 7/9] drm/rockchip: cdn-dp: Add multiple bridges to support PHY port selection Chaoyi Chen
2026-03-05 3:38 ` Claude Code Review Bot [this message]
2026-03-04 9:41 ` [PATCH v15 8/9] arm64: dts: rockchip: Add missing dp_out port for RK3399 CDN-DP Chaoyi Chen
2026-03-05 3:38 ` Claude review: " Claude Code Review Bot
2026-03-04 9:41 ` [PATCH v15 9/9] arm64: dts: rockchip: rk3399-evb-ind: Add support for DisplayPort Chaoyi Chen
2026-03-05 3:38 ` Claude review: " Claude Code Review Bot
2026-03-05 3:37 ` Claude review: Add Type-C DP support for RK3399 EVB IND board 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-20260304094152.92-8-kernel@airkyi.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