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: Thu, 05 Mar 2026 13:38:00 +1000 [thread overview]
Message-ID: <review-patch6-20260304094152.92-7-kernel@airkyi.com> (raw)
In-Reply-To: <20260304094152.92-7-kernel@airkyi.com>
Patch Review
Makes extcon optional in the CDN-DP driver. When no extcon, lane info comes from PHY bus width.
**Issue (medium): Logic change in probe may be incorrect:**
```c
- if (IS_ERR(extcon) || IS_ERR(phy))
+ if (IS_ERR(phy) || PTR_ERR(extcon) != -ENODEV)
continue;
```
The new condition `PTR_ERR(extcon) != -ENODEV` is evaluated even when `extcon` is a valid (non-error) pointer. When `extcon` is valid, `PTR_ERR(extcon)` returns a garbage value that is almost certainly not `-ENODEV`, so the condition becomes true and the port is **skipped**. This means when both extcon and phy are valid, the port would be skipped -- which breaks the existing extcon path.
The correct logic should be:
```c
if (IS_ERR(phy) || (IS_ERR(extcon) && PTR_ERR(extcon) != -ENODEV))
continue;
```
Wait, let me re-read. The original code was `if (IS_ERR(extcon) || IS_ERR(phy)) continue;` -- skip if either is an error. The new intent is: skip if phy is error, OR if extcon is an error that is NOT -ENODEV (i.e., -ENODEV is acceptable because we can work without extcon). But the current code `PTR_ERR(extcon) != -ENODEV` is true for both valid pointers and non-ENODEV errors.
Actually... `PTR_ERR()` on a valid pointer gives a nonsensical result, and that won't equal `-ENODEV`, so the `continue` would fire and the port gets skipped. **This is a bug** that would break existing boards that have both valid extcon and phy. Let me verify by checking if there's an `IS_ERR(extcon)` guard.
Looking again at the code flow more carefully: there's an earlier check `if (PTR_ERR(extcon) == -EPROBE_DEFER || PTR_ERR(phy) == -EPROBE_DEFER) return -EPROBE_DEFER;`. But `PTR_ERR` on valid pointers is still undefined/garbage.
Actually, looking at the full context: the EPROBE_DEFER check before this already returns for that case. So at this point, extcon is either valid or an error other than EPROBE_DEFER, and phy is valid or an error other than EPROBE_DEFER.
For the old extcon boards: `extcon` is valid, `phy` is valid. `IS_ERR(phy)` = false. `PTR_ERR(extcon)` on a valid pointer won't be -ENODEV. So the `continue` fires. **This breaks existing boards.**
This needs to be:
```c
if (IS_ERR(phy) || (IS_ERR(extcon) && PTR_ERR(extcon) != -ENODEV))
continue;
```
---
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 Code Review Bot [this message]
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 review: " Claude Code Review Bot
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-patch6-20260304094152.92-7-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