From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot 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 Message-ID: In-Reply-To: <20260521032854.103-5-kernel@airkyi.com> References: <20260521032854.103-1-kernel@airkyi.com> <20260521032854.103-5-kernel@airkyi.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review Makes the extcon device optional in CDN-DP, falling back to `phy_get_bus_wi= dth()` 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) !=3D -ENODEV) continue; ``` The original skips the port if either extcon OR phy is an error. The new co= de skips if phy is an error OR if `PTR_ERR(extcon) !=3D -ENODEV`. But if `e= xtcon` is **valid** (not an error), then `PTR_ERR(extcon)` is undefined beh= avior =E2=80=94 it would cast a valid pointer to a long and compare it agai= nst `-ENODEV`. This condition should be: ```c if (IS_ERR(phy) || (IS_ERR(extcon) && PTR_ERR(extcon) !=3D -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 va= lid**. Wait =E2=80=94 re-reading: extcon is fetched above with `extcon_find_edev_b= y_node`. If it returns a valid pointer, `PTR_ERR()` of a valid pointer is n= ot `-ENODEV`, so the `continue` would fire, skipping valid ports. This is a= real bug. **Issue: `property.intval =3D 0` default for polarity** ```c property.intval =3D 0; if (port->extcon) { ret =3D 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 polarit= y. This seems reasonable but should be documented or verified against the h= ardware behavior when the Type-C controller is managing polarity via the PH= Y directly. --- Generated by Claude Code Patch Reviewer