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/rockchip: cdn-dp: Support handle lane info without extcon
Date: Mon, 25 May 2026 21:00:52 +1000	[thread overview]
Message-ID: <review-patch4-20260521032854.103-5-kernel@airkyi.com> (raw)
In-Reply-To: <20260521032854.103-5-kernel@airkyi.com>

Patch Review

Makes the extcon device optional in CDN-DP, falling back to `phy_get_bus_width()` for lane count.

**Issue: Potentially incorrect filter condition in probe**
```c
-       if (IS_ERR(extcon) || IS_ERR(phy))
+       if (IS_ERR(phy) || PTR_ERR(extcon) != -ENODEV)
            continue;
```
The original skips the port if either extcon OR phy is an error. The new code skips if phy is an error OR if `PTR_ERR(extcon) != -ENODEV`. But if `extcon` is **valid** (not an error), then `PTR_ERR(extcon)` is undefined behavior — it would cast a valid pointer to a long and compare it against `-ENODEV`. This condition should be:
```c
if (IS_ERR(phy) || (IS_ERR(extcon) && PTR_ERR(extcon) != -ENODEV))
    continue;
```
The intent is: skip if phy fails, or if extcon failed with something other than `-ENODEV` (meaning extcon is genuinely absent vs. a real error like `-EPROBE_DEFER`). The current code is **buggy for the case where extcon is valid**.

Wait — re-reading: extcon is fetched above with `extcon_find_edev_by_node`. If it returns a valid pointer, `PTR_ERR()` of a valid pointer is not `-ENODEV`, so the `continue` would fire, skipping valid ports. This is a real bug.

**Issue: `property.intval = 0` default for polarity**
```c
property.intval = 0;
if (port->extcon) {
    ret = extcon_get_property(port->extcon, EXTCON_DISP_DP,
                  EXTCON_PROP_USB_TYPEC_POLARITY, &property);
```
When extcon is absent, polarity defaults to 0, which assumes normal polarity. This seems reasonable but should be documented or verified against the hardware behavior when the Type-C controller is managing polarity via the PHY directly.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-05-25 11:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-21  3:28 [PATCH 0/5] drm/bridge: Implement generic USB Type-C DP HPD bridge Chaoyi Chen
2026-05-21  3:28 ` [PATCH 1/5] " Chaoyi Chen
2026-05-25 11:00   ` Claude review: " Claude Code Review Bot
2026-05-21  3:28 ` [PATCH 2/5] drm/bridge: aux: Add drm_aux_bridge_register_from_node() Chaoyi Chen
2026-05-25 11:00   ` Claude review: " Claude Code Review Bot
2026-05-21  3:28 ` [PATCH 3/5] phy: rockchip: phy-rockchip-typec: Add DRM AUX bridge Chaoyi Chen
2026-05-21  9:06   ` Heiko Stuebner
2026-05-25 11:00   ` Claude review: " Claude Code Review Bot
2026-05-21  3:28 ` [PATCH 4/5] drm/rockchip: cdn-dp: Support handle lane info without extcon Chaoyi Chen
2026-05-25 11:00   ` Claude Code Review Bot [this message]
2026-05-21  3:28 ` [PATCH 5/5] drm/rockchip: cdn-dp: Add multiple bridges to support PHY port selection Chaoyi Chen
2026-05-25 11:00   ` Claude review: " Claude Code Review Bot
2026-05-25 11:00 ` Claude review: drm/bridge: Implement generic USB Type-C DP HPD bridge Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
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 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

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-patch4-20260521032854.103-5-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